[720/906] examples: Stop using deprecated GLib thread API
authorSebastian Dröge <slomo@circular-chaos.org>
Fri, 28 Jun 2013 09:00:46 +0000 (11:00 +0200)
committerMatthew Waters <ystreet00@gmail.com>
Sat, 15 Mar 2014 17:36:56 +0000 (18:36 +0100)
tests/examples/clutter/clutteractortee.c
tests/examples/gtk/fxtest/fxtest.c
tests/examples/gtk/fxtest/pixbufdrop.c

index 97b1fcc..657e8f6 100644 (file)
@@ -71,7 +71,7 @@ create_window (GstBus * bus, GstMessage * message, gpointer data)
 {
   GstGLClutterActor **actor = (GstGLClutterActor **) data;
   static gint count = 0;
-  static GMutex *mutex = NULL;
+  static GMutex mutex;
   // ignore anything but 'prepare-window-handle' element messages
   if (GST_MESSAGE_TYPE (message) != GST_MESSAGE_ELEMENT)
     return GST_BUS_PASS;
@@ -79,10 +79,7 @@ create_window (GstBus * bus, GstMessage * message, gpointer data)
   if (!gst_is_video_overlay_prepare_window_handle_message (message))
     return GST_BUS_PASS;
 
-  if (!mutex)
-    mutex = g_mutex_new ();
-
-  g_mutex_lock (mutex);
+  g_mutex_lock (&mutex);
 
   if (count < N_ACTORS) {
     g_message ("adding actor %d", count);
@@ -92,7 +89,7 @@ create_window (GstBus * bus, GstMessage * message, gpointer data)
     count++;
   }
 
-  g_mutex_unlock (mutex);
+  g_mutex_unlock (&mutex);
 
   gst_message_unref (message);
   return GST_BUS_DROP;
index 40298d2..124beb1 100644 (file)
@@ -132,8 +132,6 @@ main (gint argc, gchar * argv[])
     {NULL}
   };
 
-  g_thread_init (NULL);
-
   context = g_option_context_new (NULL);
   g_option_context_add_main_entries (context, options, NULL);
   g_option_context_add_group (context, gst_init_get_option_group ());
index 1607b96..5853068 100644 (file)
@@ -213,8 +213,6 @@ main (gint argc, gchar * argv[])
     {NULL}
   };
 
-  g_thread_init (NULL);
-
   context = g_option_context_new (NULL);
   g_option_context_add_main_entries (context, options, NULL);
   g_option_context_add_group (context, gst_init_get_option_group ());