From: Joonbum Ko Date: Wed, 3 Mar 2021 03:18:49 +0000 (+0900) Subject: Use tpl_gcond_timed_wait to prevent deadlock. X-Git-Tag: submit/tizen/20210316.021228~13 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F92%2F254792%2F1;p=platform%2Fcore%2Fuifw%2Flibtpl-egl.git Use tpl_gcond_timed_wait to prevent deadlock. - There may be cases where the ddk terminates without sending a fence release signal. - In such a case, waiting for signaled with tpl_gcond_wait() may result in deadlock. - The newly added tpl_gcond_timed_wait() is used to force release if a signal does not come within 16ms. Change-Id: I11801bb9f8ff4450a00b12656694940e28121a69 Signed-off-by: Joonbum Ko --- diff --git a/src/tpl_wl_egl.c b/src/tpl_wl_egl.c index c9b2592..36310eb 100644 --- a/src/tpl_wl_egl.c +++ b/src/tpl_wl_egl.c @@ -1450,8 +1450,15 @@ _thread_wl_egl_surface_fini(tpl_wl_egl_surface_t *wl_egl_surface) need_to_cancel = wl_egl_buffer->status == DEQUEUED; - if (wl_egl_buffer->status == WAITING_SIGNALED) - tpl_gcond_wait(&wl_egl_buffer->cond, &wl_egl_buffer->mutex); + if (wl_egl_buffer->status == WAITING_SIGNALED) { + tpl_result_t wait_result = TPL_ERROR_NONE; + wait_result = tpl_cond_timed_wait(&wl_egl_buffer->cond, + &wl_egl_buffer->mutex, + 16); + if (wait_result == TPL_ERROR_TIME_OUT) + TPL_WARN("timeout occured waiting signaled. wl_egl_buffer(%p)", + wl_egl_buffer); + } if (need_to_release) { tsq_err = tbm_surface_queue_release(wl_egl_surface->tbm_queue,