diff options
author | Mark Nauwelaerts <mark.nauwelaerts@collabora.co.uk> | 2012-09-12 12:22:53 +0200 |
---|---|---|
committer | Mark Nauwelaerts <mark.nauwelaerts@collabora.co.uk> | 2012-09-12 13:01:18 +0200 |
commit | bb4860d96186dbc70d91fbb08fbf5847f65b3ed3 (patch) | |
tree | 89202d67658b0ce9300cd6c9f55a7be3b972fa95 /tests/check/elements | |
parent | 47e7c91ab502e1d9a9810bacc5d87497187954b8 (diff) |
check: port to the new GLib thread API
Diffstat (limited to 'tests/check/elements')
-rw-r--r-- | tests/check/elements/queue.c | 6 | ||||
-rw-r--r-- | tests/check/elements/tee.c | 24 |
2 files changed, 15 insertions, 15 deletions
diff --git a/tests/check/elements/queue.c b/tests/check/elements/queue.c index 441017702..6682d186d 100644 --- a/tests/check/elements/queue.c +++ b/tests/check/elements/queue.c @@ -270,12 +270,12 @@ GST_START_TEST (test_non_leaky_overrun) fail_unless (overrun_count == 1); /* lock the check_mutex to block the first buffer pushed to mysinkpad */ - g_mutex_lock (check_mutex); + g_mutex_lock (&check_mutex); /* now let the queue push all buffers */ while (g_list_length (buffers) < 3) { - g_cond_wait (check_cond, check_mutex); + g_cond_wait (&check_cond, &check_mutex); } - g_mutex_unlock (check_mutex); + g_mutex_unlock (&check_mutex); fail_unless (overrun_count == 1); /* make sure we get the underrun signal before we check underrun_count */ diff --git a/tests/check/elements/tee.c b/tests/check/elements/tee.c index 777d3e134..46ff4d962 100644 --- a/tests/check/elements/tee.c +++ b/tests/check/elements/tee.c @@ -242,20 +242,20 @@ app_thread_func (gpointer data) BufferAllocHarness *h = data; /* Signal that we are about to call release_request_pad(). */ - g_mutex_lock (check_mutex); + g_mutex_lock (&check_mutex); h->app_thread_prepped = TRUE; - g_cond_signal (check_cond); - g_mutex_unlock (check_mutex); + g_cond_signal (&check_cond); + g_mutex_unlock (&check_mutex); /* Simulate that the app releases the pad while the streaming thread is in * buffer_alloc below. */ gst_element_release_request_pad (h->tee, h->tee_srcpad); /* Signal the bufferalloc function below if it's still waiting. */ - g_mutex_lock (check_mutex); + g_mutex_lock (&check_mutex); h->bufferalloc_blocked = FALSE; - g_cond_signal (check_cond); - g_mutex_unlock (check_mutex); + g_cond_signal (&check_cond); + g_mutex_unlock (&check_mutex); return NULL; } @@ -282,21 +282,21 @@ final_sinkpad_bufferalloc (GstPad * pad, guint64 offset, guint size, fail_if (h->app_thread == NULL); /* Wait for the app thread to get ready to call release_request_pad(). */ - g_mutex_lock (check_mutex); + g_mutex_lock (&check_mutex); while (!h->app_thread_prepped) - g_cond_wait (check_cond, check_mutex); - g_mutex_unlock (check_mutex); + g_cond_wait (&check_cond, &check_mutex); + g_mutex_unlock (&check_mutex); /* Now wait for it to do that within a second, to avoid deadlocking * in the event of future changes to the locking semantics. */ - g_mutex_lock (check_mutex); + g_mutex_lock (&check_mutex); g_get_current_time (&deadline); deadline.tv_sec += 1; while (h->bufferalloc_blocked) { - if (!g_cond_timed_wait (check_cond, check_mutex, &deadline)) + if (!g_cond_timed_wait (&check_cond, &check_mutex, &deadline)) break; } - g_mutex_unlock (check_mutex); + g_mutex_unlock (&check_mutex); } *buf = gst_buffer_new_and_alloc (size); |