After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 650252 - Possible deadlock when canceling
Possible deadlock when canceling
Status: RESOLVED OBSOLETE
Product: glib
Classification: Platform
Component: gio
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2011-05-15 19:52 UTC by David Zeuthen (not reading bugmail)
Modified: 2018-05-24 13:08 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description David Zeuthen (not reading bugmail) 2011-05-15 19:52:12 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.)
Comment 1 GNOME Infrastructure Team 2018-05-24 13:08:36 UTC
-- 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.