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 527967 - gst_gerror_get_type is not thread safe
gst_gerror_get_type is not thread safe
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other Linux
: Normal normal
: 0.10.20
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2008-04-14 05:38 UTC by Olivier Crête
Modified: 2008-04-14 08:48 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Use the gonce functions to init the class thread safe (1000 bytes, patch)
2008-04-14 05:39 UTC, Olivier Crête
reviewed Details | Review

Description Olivier Crête 2008-04-14 05:38:12 UTC
If two threads call it at the same time, failure occurs. I'm attaching a patch that uses the gonce stuff from glib's G_DEFINE_TYPE, hopefully, we'll be able to replace all of that soon with the patch from bug #449565
Comment 1 Olivier Crête 2008-04-14 05:39:42 UTC
Created attachment 109210 [details] [review]
Use the gonce functions to init the class thread safe

The only problem is that these g_once* functions are new in glib 2.14... That said, we should probably depend on glib 2.16 since class init isn't thread safe before then anyways.
Comment 2 Tim-Philipp Müller 2008-04-14 08:48:56 UTC
I don't think we'll be able to depend on GLib 2.14 or 2.16 any time soon, so for now it's probably best to just pre-register the GType from gst_init like we do with all the other types (could use the old GOnce stuff with an extra function, but if it's together with the other stuff it's more likely to get cleaned up properly once we can actually depend on newer GLib versions).


 2008-04-14  Tim-Philipp Müller  <tim at centricular dot net>

        * gst/gst.c: (init_post), (gst_deinit):
          Pre-register GstGError GType from a thread-safe context
          (fixes #527967); unref enum type classes in deinit.