From: YoungHun Kim Date: Mon, 4 Nov 2019 09:53:32 +0000 (+0900) Subject: Revert "Wait until context is owned by worker thread to avoid context owner warning" X-Git-Tag: submit/tizen_4.0/20191111.100050^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fheads%2Ftizen_4.0;p=platform%2Fupstream%2Fmurphy.git Revert "Wait until context is owned by worker thread to avoid context owner warning" This reverts commit 9b28f921bebb5afdf1369e4eebd6cd06f459f989. Change-Id: I47ac5af298c785ae9ecc5476c8e9c83b4a8cbff9 --- diff --git a/packaging/murphy.spec b/packaging/murphy.spec index 6949b37..ecf897a 100644 --- a/packaging/murphy.spec +++ b/packaging/murphy.spec @@ -29,7 +29,7 @@ Summary: Resource policy framework Name: murphy Version: 0.0.75 -Release: 18 +Release: 17 License: BSD-3-Clause Group: System/Service URL: http://01.org/murphy/ diff --git a/src/common/glib-glue.c b/src/common/glib-glue.c index b060e8f..a1f7275 100644 --- a/src/common/glib-glue.c +++ b/src/common/glib-glue.c @@ -45,7 +45,6 @@ typedef struct { GMutex glue_internal_lock; GCond loop_cond; gint ref_count; - gboolean thread_ready; } glib_glue_t; @@ -478,7 +477,6 @@ static void unregister(void *data) } g_mutex_unlock(&glue->glue_internal_lock); - g_main_context_unref(loop_ctx); glue_unref(glue); } @@ -502,18 +500,12 @@ thread_main (gpointer data) g_return_val_if_fail(glue, NULL); GMainContext *thread_main_context = g_main_loop_get_context(glue->gml); - /* Set up the thread's context and run it. */ - g_main_context_push_thread_default(thread_main_context); + /* Set up the thread’s context and run it. */ + g_main_context_push_thread_default (thread_main_context); - g_mutex_lock(&glue->glue_internal_lock); - glue->thread_ready = TRUE; - g_cond_signal(&glue->loop_cond); - g_mutex_unlock(&glue->glue_internal_lock); + g_main_loop_run (glue->gml); - g_main_loop_run(glue->gml); - g_main_loop_unref(glue->gml); - - g_main_context_pop_thread_default(thread_main_context); + g_main_context_pop_thread_default (thread_main_context); g_mutex_lock(&glue->glue_internal_lock); g_cond_signal(&glue->loop_cond); @@ -522,16 +514,6 @@ thread_main (gpointer data) return NULL; } - -static gboolean check_owner(gpointer data) -{ - if (data != NULL) - g_assert(data == g_thread_self()); - - return FALSE; -} - - int mrp_mainloop_register_with_glib(mrp_mainloop_t *ml, GMainLoop *gml) { glib_glue_t *glue; @@ -552,11 +534,6 @@ int mrp_mainloop_register_with_glib(mrp_mainloop_t *ml, GMainLoop *gml) mrp_log_error("Thread creation failed"); return FALSE; } - g_mutex_lock(&glue->glue_internal_lock); - while (!glue->thread_ready) - g_cond_wait(&glue->loop_cond, &glue->glue_internal_lock); - g_mutex_unlock(&glue->glue_internal_lock); - g_main_context_invoke(loop_ctx, check_owner, glue->worker); } return TRUE; }