GNOME Bugzilla – Bug 749496
g_main_context_invoke_full race condition
Last modified: 2018-05-24 17:50:29 UTC
Created attachment 303481 [details] example showing the race condition g_main_context_invoke_full contains a race condition. When the context is owned by current thread, but its ownership changes in invocation of the callback function, it will be invoked on the wrong thread. Suggested solution 1: acquire the context before running the loop and release it after, similar to what is done if the context is thread-default. Suggested solution 2: keep checking if the context is owned after each callback invocation and the callback returned TRUE. When the context ownership changes, fall through to create idle source.
-- GitLab Migration Automatic Message -- This bug has been migrated to GNOME's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/glib/issues/1038.