libs/gst/check/gstcheck.*: Add a cond/mutex to the check support lib, signal this...
authorMichael Smith <msmith@xiph.org>
Fri, 2 Jun 2006 16:41:02 +0000 (16:41 +0000)
committerMichael Smith <msmith@xiph.org>
Fri, 2 Jun 2006 16:41:02 +0000 (16:41 +0000)
Original commit message from CVS:
* libs/gst/check/gstcheck.c: (gst_check_init),
(gst_check_chain_func):
* libs/gst/check/gstcheck.h:
Add a cond/mutex to the check support lib, signal this whenever we
add to the buffers list. This will allow tests to not busy-wait on
the buffer-list.

ChangeLog
libs/gst/check/gstcheck.c
libs/gst/check/gstcheck.h

index 721f649..346437d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2006-06-02  Michael Smith  <msmith@fluendo.com>
+
+       * libs/gst/check/gstcheck.c: (gst_check_init),
+       (gst_check_chain_func):
+       * libs/gst/check/gstcheck.h:
+         Add a cond/mutex to the check support lib, signal this whenever we
+         add to the buffers list. This will allow tests to not busy-wait on
+         the buffer-list.
+
 2006-06-02  Thomas Vander Stichele  <thomas at apestaart dot org>
 
        * libs/gst/dataprotocol/dataprotocol.c:
index 5bf728d..0d39567 100644 (file)
@@ -95,6 +95,9 @@ gst_check_init (int *argc, char **argv[])
       gst_check_log_critical_func, NULL);
   g_log_set_handler ("GLib-GObject", G_LOG_LEVEL_CRITICAL | G_LOG_LEVEL_WARNING,
       gst_check_log_critical_func, NULL);
+
+  check_cond = g_cond_new ();
+  check_mutex = g_mutex_new ();
 }
 
 /* message checking */
@@ -120,6 +123,10 @@ gst_check_chain_func (GstPad * pad, GstBuffer * buffer)
   GST_DEBUG ("chain_func: received buffer %p", buffer);
   buffers = g_list_append (buffers, buffer);
 
+  g_mutex_lock (check_mutex);
+  g_cond_signal (check_cond);
+  g_mutex_unlock (check_mutex);
+
   return GST_FLOW_OK;
 }
 
index 749ccc8..75dbae3 100644 (file)
@@ -47,6 +47,9 @@ extern gboolean _gst_check_expecting_log;
 /* global variables used in test methods */
 GList * buffers;
 
+GMutex *check_mutex;
+GCond *check_cond;
+
 void gst_check_init (int *argc, char **argv[]);
 
 GstFlowReturn gst_check_chain_func (GstPad *pad, GstBuffer *buffer);