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 773262 - gresolver: Make get_default() thread-safe
gresolver: Make get_default() thread-safe
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: gio
unspecified
Other All
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2016-10-20 09:17 UTC by Sebastian Dröge (slomo)
Modified: 2016-10-20 14:51 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
GResolver – Make get_default() thread-safe (1.50 KB, patch)
2016-10-20 09:17 UTC, Sebastian Dröge (slomo)
committed Details | Review

Description Sebastian Dröge (slomo) 2016-10-20 09:17:16 UTC
See commit message
Comment 1 Sebastian Dröge (slomo) 2016-10-20 09:17:20 UTC
Created attachment 338082 [details] [review]
GResolver – Make get_default() thread-safe
Comment 2 Colin Walters 2016-10-20 14:01:46 UTC
Review of attachment 338082 [details] [review]:

::: gio/gresolver.c
@@ +205,3 @@
+  GResolver *ret;
+
+  G_LOCK (default_resolver);

Don't we more commonly use g_once_init_enter()?
Comment 3 Sebastian Dröge (slomo) 2016-10-20 14:09:11 UTC
It's possible to set a different default resolver at any time, it's not a one-time thing
Comment 4 Sebastian Dröge (slomo) 2016-10-20 14:09:49 UTC
How much sense that makes, I don't know... but that's what the code allows and intents to allow apparently. See the unref in the setter
Comment 5 Colin Walters 2016-10-20 14:22:10 UTC
Review of attachment 338082 [details] [review]:

OK, yep, makes sense to me.
Comment 6 Sebastian Dröge (slomo) 2016-10-20 14:50:26 UTC
commit 2a970e33a474960bfd1204797caf41996267f20c
Author: Sebastian Dröge <sebastian@centricular.com>
Date:   Thu Oct 20 12:16:18 2016 +0300

    gresolver: Make get_default() thread-safe
    
    https://bugzilla.gnome.org/show_bug.cgi?id=773262