ecore glib support - if we are not the main ctx owner loop to acquire 65/143265/2
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>
Wed, 9 Aug 2017 07:18:10 +0000 (16:18 +0900)
committerGerrit Code Review <gerrit@review.ap-northeast-2.compute.internal>
Wed, 9 Aug 2017 08:08:02 +0000 (08:08 +0000)
the code didn't try acquire every loop if we were not, so it wouldnt
wake up if someone stole context (and then gave it up). found by roy!

@fix

Change-Id: Iff3eb1161d0c689e3fc3efa91bf89751629ce4e0

src/lib/ecore/ecore_glib.c

index 80d48ff..b52c032 100644 (file)
@@ -196,11 +196,8 @@ _ecore_glib_select(int             ecore_fds,
 
    ctx = g_main_context_default();
 
-   if (!g_main_context_acquire(ctx))
-     {
-        while (!g_main_context_is_owner(ctx))
-          g_thread_yield();
-     }
+   while (!g_main_context_acquire(ctx))
+     g_thread_yield();
 
 #if GLIB_CHECK_VERSION(2,32,0)
    g_rec_mutex_lock(_ecore_glib_select_lock);