From: Boram Park Date: Mon, 2 Apr 2018 06:51:42 +0000 (+0900) Subject: thread: only allow a sync event from tdm-thread to display-thread X-Git-Tag: submit/tizen/20180411.042300~14 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4abfab3661147e28398df7be7b35f3cf7973be8f;p=platform%2Fcore%2Fuifw%2Flibtdm.git thread: only allow a sync event from tdm-thread to display-thread A sync-type event from display-thread to tdm-thread can't be handled. If sync-type events happen in both threads at the same time, it would make a deadlock issue. Change-Id: Ic45207a173dfe9413f419506da1a6d36e86d06e3 --- diff --git a/src/tdm_thread.c b/src/tdm_thread.c index 6ca28f2e..ea891a24 100644 --- a/src/tdm_thread.c +++ b/src/tdm_thread.c @@ -640,16 +640,18 @@ tdm_thread_cb_call(void *object, tdm_thread_cb_base *cb_base, unsigned int propa assert(find_funcs[cb_base->type] != NULL); + if (keep_private_thread && keep_private_thread->thread_tid != caller_tid) { + /* A sync-type event from display-thread to tdm-thread can't be handled. + * If sync-type events happen in both threads at the same time, + * it would make a deadlock issue. + */ + assert(cb_base->sync != 1); + } + if (tdm_debug_module & TDM_DEBUG_THREAD) TDM_INFO("'%s' thread_cb (sync:%d, propagation:%d) ------", tdm_cb_type_str(cb_base->type), cb_base->sync, propagation); - /* handling only output-status as sync. below logic can't handle two sync-type events */ - if (cb_base->type == TDM_THREAD_CB_OUTPUT_STATUS) - assert(cb_base->sync == 1); - else - assert(cb_base->sync == 0); - if (!object) { object = find_funcs[cb_base->type](private_display, cb_base->object_stamp); if (!object) {