From af8dcff0a8cb47570383ef27f170280e98ac693a Mon Sep 17 00:00:00 2001 From: jphnix Date: Tue, 30 Jan 2024 10:33:55 +0000 Subject: [PATCH] Add missing Lock - gthread->loop is held with thread_mutex. - But it doesn't hold thread_mutex in tpl_gthread_add_idle Change-Id: Ibaddbcf7e4d4b9ec661ee69c0a95dbc517970ea2 --- src/tpl_utils_gthread.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/tpl_utils_gthread.c b/src/tpl_utils_gthread.c index 54cd2b6..466baef 100644 --- a/src/tpl_utils_gthread.c +++ b/src/tpl_utils_gthread.c @@ -627,7 +627,10 @@ tpl_gthread_add_idle(tpl_gthread *gthread, tpl_gsource_func idle_cb, void *data) g_source_set_callback(idle_source, idle_cb, (gpointer)data, NULL); + + g_mutex_lock(>hread->thread_mutex); g_source_attach(idle_source, g_main_loop_get_context(gthread->loop)); + g_mutex_unlock(>hread->thread_mutex); g_source_unref(idle_source); return TPL_ERROR_NONE; -- 2.34.1