All requests and events of a wayland display are handled
in a TDM thread.
Change-Id: I9469304a631c45a5d71dfcd27c8cc8d78d7be253
if (tdm_debug_thread)
TDM_INFO("dispatch");
if (tdm_debug_thread)
TDM_INFO("dispatch");
+ if (tdm_thread_is_running() &&
+ tdm_thread_in_display_thread(syscall(SYS_gettid))) {
+ TDM_NEVER_GET_HERE();
+ return TDM_ERROR_OPERATION_FAILED;
+ }
+
/* Don't set timeout to -1. It can make deadblock by two mutex locks.
* If need to set -1, use poll() and call tdm_event_loop_dispatch() after
* escaping polling.
/* Don't set timeout to -1. It can make deadblock by two mutex locks.
* If need to set -1, use poll() and call tdm_event_loop_dispatch() after
* escaping polling.
if (wl_event_loop_dispatch(private_loop->wl_loop, 0) < 0)
TDM_ERR("dispatch failed");
if (wl_event_loop_dispatch(private_loop->wl_loop, 0) < 0)
TDM_ERR("dispatch failed");
+ wl_display_flush_clients(private_loop->wl_display);
+
TDM_RETURN_IF_FAIL(private_loop->wl_display != NULL);
TDM_RETURN_IF_FAIL(private_loop->wl_display != NULL);
+ if (tdm_thread_is_running() &&
+ tdm_thread_in_display_thread(syscall(SYS_gettid))) {
+ TDM_NEVER_GET_HERE();
+ return;
+ }
+
wl_display_flush_clients(private_loop->wl_display);
}
wl_display_flush_clients(private_loop->wl_display);
}
_pthread_mutex_unlock(&private_display->lock);
_pthread_mutex_unlock(&private_display->lock);
- tdm_event_loop_flush(private_loop->dpy);
-