tpl_gmutex_unlock(&wl_egl_display->tdm.tdm_mutex);
}
- /* This is a protection to prevent problems that arise in unexpected situations
- * that g_cond_wait cannot work normally.
- * When calling tpl_gsource_destroy() with destroy_in_thread is TPL_TRUE,
- * caller should use tpl_gcond_wait() in the loop with checking finalized flag
- * */
- tpl_gmutex_lock(&wl_egl_display->disp_mutex);
- // Send destroy mesage to thread
- tpl_gsource_destroy(wl_egl_display->disp_source, TPL_TRUE);
- while (wl_egl_display->disp_source && !wl_egl_display->gsource_finalized) {
- tpl_gcond_wait(&wl_egl_display->disp_cond, &wl_egl_display->disp_mutex);
+ if (wl_egl_display->disp_source) {
+ tpl_gmutex_lock(&wl_egl_display->disp_mutex);
+ // Send destroy mesage to thread
+ tpl_gsource_destroy(wl_egl_display->disp_source, TPL_TRUE);
+ /* This is a protection to prevent problems that arise in unexpected situations
+ * that g_cond_wait cannot work normally.
+ * When calling tpl_gsource_destroy() with destroy_in_thread is TPL_TRUE,
+ * caller should use tpl_gcond_wait() in the loop with checking finalized flag
+ * */
+ while (!wl_egl_display->gsource_finalized) {
+ tpl_gcond_wait(&wl_egl_display->disp_cond, &wl_egl_display->disp_mutex);
+ }
+ wl_egl_display->disp_source = NULL;
+ tpl_gmutex_unlock(&wl_egl_display->disp_mutex);
}
- wl_egl_display->disp_source = NULL;
- tpl_gmutex_unlock(&wl_egl_display->disp_mutex);
if (wl_egl_display->thread) {
tpl_gthread_destroy(wl_egl_display->thread);
_tpl_wl_egl_surface_buffer_clear(wl_egl_surface);
- /* This is a protection to prevent problems that arise in unexpected situations
- * that g_cond_wait cannot work normally.
- * When calling tpl_gsource_destroy() with destroy_in_thread is TPL_TRUE,
- * caller should use tpl_gcond_wait() in the loop with checking finalized flag
- * */
- tpl_gmutex_lock(&wl_egl_surface->surf_mutex);
- // Send destroy mesage to thread
- tpl_gsource_destroy(wl_egl_surface->surf_source, TPL_TRUE);
- while (wl_egl_surface->surf_source && !wl_egl_surface->gsource_finalized) {
- tpl_gcond_wait(&wl_egl_surface->surf_cond, &wl_egl_surface->surf_mutex);
+ if (wl_egl_surface->surf_source) {
+ tpl_gmutex_lock(&wl_egl_surface->surf_mutex);
+ // Send destroy mesage to thread
+ tpl_gsource_destroy(wl_egl_surface->surf_source, TPL_TRUE);
+ /* This is a protection to prevent problems that arise in unexpected situations
+ * that g_cond_wait cannot work normally.
+ * When calling tpl_gsource_destroy() with destroy_in_thread is TPL_TRUE,
+ * caller should use tpl_gcond_wait() in the loop with checking finalized flag
+ * */
+ while (!wl_egl_surface->gsource_finalized) {
+ tpl_gcond_wait(&wl_egl_surface->surf_cond, &wl_egl_surface->surf_mutex);
+ }
+ wl_egl_surface->surf_source = NULL;
+ tpl_gmutex_unlock(&wl_egl_surface->surf_mutex);
}
- wl_egl_surface->surf_source = NULL;
- tpl_gmutex_unlock(&wl_egl_surface->surf_mutex);
_print_buffer_lists(wl_egl_surface);