GNOME Bugzilla – Bug 658182
g_main_loop_quit() race condition
Last modified: 2011-09-05 14:46:17 UTC
Thread 1 Thread 2 -------- -------- g_main_loop_run { loop->is_running = TRUE g_main_context_iterate { g_main_loop_quit { LOCK_CONTEXT g_main_context_prepare { LOCK_CONTEXT { ... loop->is_running = FALSE ... g_main_context_wakeup_unlocked { ... /* no-op, because ... * context->poll_waiting is FALSE ... */ ... } ... UNLOCK_CONTEXT } context->poll_waiting = TRUE } g_poll { ... gio/tests/tls-interaction hits this a lot for some reason. I'm not sure that the attached patch is the right fix, but it fixes the problem, and doesn't break anything else in "make check"
Created attachment 195627 [details] [review] gmain: fix a race condition in g_main_loop_quit() g_main_context_wakeup() needs to signal context->wakeup regardless of what the context is currently doing, because otherwise the context may get stuck polling forever without noticing whatever it was supposed to have woken up for.
Is this the same race that is described in bug 632301 ?
yup *** This bug has been marked as a duplicate of bug 632301 ***