--- a/gstreamer_core/gst/gstinterface.c Wed Mar 24 17:58:42 2010 -0500
+++ b/gstreamer_core/gst/gstinterface.c Wed Mar 24 18:04:17 2010 -0500
@@ -51,9 +51,10 @@
GType
gst_implements_interface_get_type (void)
{
- static GType gst_interface_type = 0;
+ static volatile gsize gst_interface_type = 0;
- if (!gst_interface_type) {
+ if (g_once_init_enter (&gst_interface_type)) {
+ GType _type;
static const GTypeInfo gst_interface_info = {
sizeof (GstImplementsInterfaceClass),
(GBaseInitFunc) gst_implements_interface_class_init,
@@ -67,10 +68,11 @@
NULL
};
- gst_interface_type = g_type_register_static (G_TYPE_INTERFACE,
+ _type = g_type_register_static (G_TYPE_INTERFACE,
"GstImplementsInterface", &gst_interface_info, 0);
- g_type_interface_add_prerequisite (gst_interface_type, GST_TYPE_ELEMENT);
+ g_type_interface_add_prerequisite (_type, GST_TYPE_ELEMENT);
+ g_once_init_leave (&gst_interface_type, _type);
}
return gst_interface_type;
@@ -188,15 +190,11 @@
gboolean
gst_implements_interface_check (gpointer from, GType type)
{
- GstImplementsInterface *iface;
-
/* check cast, return FALSE if it fails, don't give a warning... */
if (!G_TYPE_CHECK_INSTANCE_TYPE (from, type)) {
return FALSE;
}
- iface = G_TYPE_CHECK_INSTANCE_CAST (from, type, GstImplementsInterface);
-
/* now, if we're an element (or derivative), is this thing
* actually implemented for real? */
if (GST_IS_ELEMENT (from)) {