From 0d43525e605b706edb79ed955ff2ee30b3ffa337 Mon Sep 17 00:00:00 2001 From: Joonbum Ko Date: Wed, 5 Jan 2022 16:48:11 +0900 Subject: [PATCH] Remove finalizer source to before cond_signal Change-Id: Iaeb1b75ecff8860f10f82a21e8ea2be972e70dad Signed-off-by: Joonbum Ko --- src/tpl_utils_gthread.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/tpl_utils_gthread.c b/src/tpl_utils_gthread.c index 51a6dc7..0c3b203 100644 --- a/src/tpl_utils_gthread.c +++ b/src/tpl_utils_gthread.c @@ -187,9 +187,12 @@ _thread_source_dispatch(GSource *source, GSourceFunc cb, gpointer data) g_mutex_lock(&thread->thread_mutex); __gsource_remove_and_destroy(del_source); + __gsource_remove_and_destroy(gsource); g_cond_signal(&thread->thread_cond); g_mutex_unlock(&thread->thread_mutex); + + return G_SOURCE_REMOVE; } } } @@ -201,8 +204,7 @@ _thread_source_dispatch(GSource *source, GSourceFunc cb, gpointer data) gsource, gsource->fd, cond); } - if (gsource->type == SOURCE_TYPE_DISPOSABLE || - gsource->type == SOURCE_TYPE_FINALIZER) { + if (gsource->type == SOURCE_TYPE_DISPOSABLE) { g_mutex_lock(&thread->thread_mutex); __gsource_remove_and_destroy(gsource); ret = G_SOURCE_REMOVE; -- 2.7.4