GNOME Bugzilla – Bug 527967
gst_gerror_get_type is not thread safe
Last modified: 2008-04-14 08:48:56 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
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.
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.