GNOME Bugzilla – Bug 650252
Possible deadlock when canceling
Last modified: 2018-05-24 13:08:36 UTC
Consier his ::cancelled signal handler static void on_cancelled (GCancellable *cancellable, gpointer user_data) { MyData *data = user_data; g_cancellable_cancel (data->other_cancellable); } where data->other_cancellable != cancellable. It will deadlock if being called from g_cancellable_connect(). Should either do the callback without holding the lock or should use a lock per cancellable. (While on this topic, it would be nice to have some more convenience helpers on GCancellable - for example some way to add timeouts (what I tried to do here) and maybe also a way to chain cancelables together. I find, writing applications and libraries, that it's a little lacking as is.)
-- 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/410.