Remove finalizer source to before cond_signal 60/268960/1
authorJoonbum Ko <joonbum.ko@samsung.com>
Wed, 5 Jan 2022 07:48:11 +0000 (16:48 +0900)
committerJoonbum Ko <joonbum.ko@samsung.com>
Wed, 5 Jan 2022 07:59:25 +0000 (16:59 +0900)
Change-Id: Iaeb1b75ecff8860f10f82a21e8ea2be972e70dad
Signed-off-by: Joonbum Ko <joonbum.ko@samsung.com>
src/tpl_utils_gthread.c

index 51a6dc7..0c3b203 100644 (file)
@@ -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;