From cffc8b39ddda18ef339799dfb64d53c0401b7aa3 Mon Sep 17 00:00:00 2001 From: Boram Park Date: Mon, 2 Apr 2018 07:49:01 +0900 Subject: [PATCH] output: call output_change callbacks asynchronously Change-Id: I72a8460101efd8e12a109c465ecd8249890b7801 --- src/tdm_output.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/tdm_output.c b/src/tdm_output.c index 691d7bb..6543b7d 100644 --- a/src/tdm_output.c +++ b/src/tdm_output.c @@ -259,6 +259,7 @@ static tdm_error _tdm_output_call_thread_cb_status(tdm_private_output *private_output, tdm_output_conn_status status) { tdm_thread_cb_output_status output_status; + pid_t caller_tid = syscall(SYS_gettid); tdm_error ret; memset(&output_status, 0, sizeof output_status); @@ -266,7 +267,10 @@ _tdm_output_call_thread_cb_status(tdm_private_output *private_output, tdm_output output_status.base.length = sizeof output_status; output_status.base.object_stamp = private_output->stamp; output_status.base.data = NULL; - output_status.base.sync = 1; + if (tdm_thread_in_display_thread(caller_tid)) + output_status.base.sync = 0; + else + output_status.base.sync = 1; output_status.status = status; ret = tdm_thread_cb_call(private_output, &output_status.base, 1); -- 2.7.4