Use macros to register boxed types thread safely
[platform/upstream/gstreamer.git] / gst / gstiterator.c
index 56675b4..99369df 100644 (file)
@@ -85,16 +85,8 @@ gst_iterator_copy (const GstIterator * it)
   return copy;
 }
 
-GType
-gst_iterator_get_type (void)
-{
-  static GType type = 0;
-
-  if (G_UNLIKELY (type == 0))
-    type = g_boxed_type_register_static ("GstIterator",
-        (GBoxedCopyFunc) gst_iterator_copy, (GBoxedFreeFunc) gst_iterator_free);
-  return type;
-}
+G_DEFINE_BOXED_TYPE (GstIterator, gst_iterator,
+    (GBoxedCopyFunc) gst_iterator_copy, (GBoxedFreeFunc) gst_iterator_free);
 
 static void
 gst_iterator_init (GstIterator * it,
@@ -121,7 +113,7 @@ gst_iterator_init (GstIterator * it,
 }
 
 /**
- * gst_iterator_new:
+ * gst_iterator_new: (skip)
  * @size: the size of the iterator structure
  * @type: #GType of children
  * @lock: pointer to a #GMutex.
@@ -219,7 +211,7 @@ gst_list_iterator_free (GstListIterator * it)
 }
 
 /**
- * gst_iterator_new_list:
+ * gst_iterator_new_list: (skip)
  * @type: #GType of elements
  * @lock: pointer to a #GMutex protecting the list.
  * @master_cookie: pointer to a guint32 that is incremented when the list