You know the rule: don't ever call g_main_loop_new(NULL).
I got a deadlock in gnome-software because a pluginloader thread was owning the default context.
Created attachment 86022 [details] [review]
PkTask: make thread-default-context aware
We must install idle sources in the right main context, otherwise
PkTask becomes impossible to use thread safely.
Created attachment 86023 [details] [review]
PkTaskSync: don't iterate the default main context
Iterating the default main context is wrong in all occasions (as
most applications are not prepared to deal with the reentrancy
caused by gtk+ sources). It becomes even more wrong if the library
is supposed to be thread safe, and the method is called from
a secondary thread.
Both applied, thanks!