return;
}
+ g_mutex_lock(&_twe_ctx->thread_mutex);
TPL_OBJECT_LOCK(&disp_source->obj);
/* If disp_source is in prepared state, cancel it */
wl_event_queue_destroy(disp_source->ev_queue);
TPL_OBJECT_UNLOCK(&disp_source->obj);
+ TPL_LOG_T("WL_EGL", "[DEL] twe_display(%p) wl_display(%p)",
+ disp_source, disp_source->disp);
+
g_source_remove_poll(&disp_source->gsource, &disp_source->gfd);
g_source_destroy(&disp_source->gsource);
+ g_source_unref(&disp_source->gsource);
- TPL_LOG_T("WL_EGL", "[DEL] twe_display(%p) wl_display(%p)",
- disp_source, disp_source->disp);
+ g_cond_signal(&_twe_ctx->thread_cond);
+ g_mutex_unlock(&_twe_ctx->thread_mutex);
}
twe_display_h
_twe_display_fini_wl_tbm_client(source->wl_tbm_client);
source->wl_tbm_client = NULL;
- _twe_thread_del_source_trigger(disp_del_source);
-
- while (!g_source_is_destroyed(&source->gsource)) {
- /* Waiting for destroying disp_source */
- }
+ g_mutex_lock(&_twe_ctx->thread_mutex);
- g_source_unref(&source->gsource);
+ _twe_thread_del_source_trigger(disp_del_source);
+ g_cond_wait(&_twe_ctx->thread_cond, &_twe_ctx->thread_mutex);
+ g_mutex_unlock(&_twe_ctx->thread_mutex);
_twe_del_source_fini(disp_del_source);