int i;
tpl_wl_egl_buffer_t *wl_egl_buffer = NULL;
for (i = 0; i < BUFFER_ARRAY_SIZE; i++) {
+ buffer_status_t status;
tpl_gmutex_lock(&wl_egl_surface->buffers_mutex);
wl_egl_buffer = wl_egl_surface->buffers[i];
tpl_gmutex_unlock(&wl_egl_surface->buffers_mutex);
- if (wl_egl_buffer && wl_egl_buffer->status == COMMITTED) {
- wl_egl_buffer->status = RELEASED;
+ if (wl_egl_buffer) {
+ tpl_gmutex_lock(&wl_egl_buffer->mutex);
+ status = wl_egl_buffer->status;
+ tpl_gmutex_unlock(&wl_egl_buffer->mutex);
+ } else {
+ continue;
+ }
+
+ if (status > ENQUEUED && status <= COMMITTED) {
tsq_err = tbm_surface_queue_release(wl_egl_surface->tbm_queue,
wl_egl_buffer->tbm_surface);
if (tsq_err != TBM_SURFACE_QUEUE_ERROR_NONE)
"wl_egl_surface(%p) tbm_queue(%p)",
wl_egl_surface, wl_egl_surface->tbm_queue);
+ _print_buffer_lists(wl_egl_surface);
+
return TPL_ERROR_NONE;
}
wl_display_flush(wl_egl_display->wl_display);
}
+ tpl_gmutex_lock(&wl_egl_buffer->mutex);
#if TIZEN_FEATURE_ENABLE
if (wl_egl_buffer->buffer_release) {
zwp_linux_buffer_release_v1_destroy(wl_egl_buffer->buffer_release);
wl_egl_buffer->bo_name = -1;
wl_egl_buffer->status = RELEASED;
+ tpl_gmutex_unlock(&wl_egl_buffer->mutex);
+ tpl_gmutex_clear(&wl_egl_buffer->mutex);
+ tpl_gcond_clear(&wl_egl_buffer->cond);
free(wl_egl_buffer);
}