libs/gst/check/gstcheck.h: Allow check tests to use
authorPeter Kjellerstedt <pkj@axis.com>
Wed, 10 Dec 2008 15:19:45 +0000 (15:19 +0000)
committerPeter Kjellerstedt <pkj@axis.com>
Wed, 10 Dec 2008 15:19:45 +0000 (15:19 +0000)
Original commit message from CVS:
* libs/gst/check/gstcheck.h: Allow check tests to use
MAIN_START_THREADS()/MAIN_STOP_THREADS() multiple times. Also allows
CK_FORK=no to be used with multiple check test that use threads.

ChangeLog
libs/gst/check/gstcheck.h

index e26b044..51f90e7 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2008-12-10  Peter Kjellerstedt  <pkj@axis.com>
+
+       * libs/gst/check/gstcheck.h: Allow check tests to use
+       MAIN_START_THREADS()/MAIN_STOP_THREADS() multiple times. Also allows
+       CK_FORK=no to be used with multiple check test that use threads.
+
 2008-12-09  Sebastian Dröge  <sebastian.droege@collabora.co.uk>
 
        * gst/gstutils.c: (gst_element_get_compatible_pad):
index 68f7810..cf10993 100644 (file)
@@ -264,9 +264,11 @@ MAIN_SYNCHRONIZE();
 G_STMT_START {                         \
   _gst_check_threads_running = TRUE;   \
                                        \
-  mutex = g_mutex_new ();              \
-  start_cond = g_cond_new ();          \
-  sync_cond = g_cond_new ();           \
+  if (mutex == NULL) {                 \
+    mutex = g_mutex_new ();            \
+    start_cond = g_cond_new ();                \
+    sync_cond = g_cond_new ();         \
+  }                                    \
 } G_STMT_END;
 
 #define MAIN_START_THREAD_FUNCTIONS(count, function, data)     \
@@ -307,6 +309,8 @@ G_STMT_START {                                                      \
   /* join all threads */                                       \
   GST_DEBUG ("MAIN: joining");                                 \
   g_list_foreach (thread_list, (GFunc) g_thread_join, NULL);   \
+  g_list_free (thread_list);                                   \
+  thread_list = NULL;                                          \
   GST_DEBUG ("MAIN: joined");                                  \
 } G_STMT_END;