Commit 0c0469b5 authored by Paolo Bonzini's avatar Paolo Bonzini Committed by Colin Walters

gmain: Signal wakeups if context has never been acquired as well

Should address backwards compatibility with how qemu is using

See Colin Walters's avatarColin Walters <>
parent 3d7534ea
......@@ -1127,7 +1127,17 @@ source_remove_from_context (GSource *source,
static void
conditional_wakeup (GMainContext *context)
if (context->owner && context->owner != G_THREAD_SELF)
/* We want to signal wakeups in two cases:
* 1 When the context is owned by another thread
* 2 When the context owner is NULL (two subcases)
* 2a Possible if the context has never been acquired
* 2b Or if the context has no current owner
* At least case 2a) is necessary to ensure backwards compatibility with
* qemu's use of GMainContext.
if (context->owner != G_THREAD_SELF)
g_wakeup_signal (context->wakeup);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment