From 6f3d70b5e24cebbd6fd8c3a665a801628ef912ff Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Sun, 27 Jan 2013 17:20:50 +0100 Subject: DecoderControl, InputStream: use Mutex/Cond instead of GMutex/GCond --- src/InputInternal.cxx | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'src/InputInternal.cxx') diff --git a/src/InputInternal.cxx b/src/InputInternal.cxx index 8fc4fa0a..52ca4cf0 100644 --- a/src/InputInternal.cxx +++ b/src/InputInternal.cxx @@ -25,7 +25,7 @@ void input_stream_init(struct input_stream *is, const struct input_plugin *plugin, - const char *uri, GMutex *mutex, GCond *cond) + const char *uri, Mutex &mutex, Cond &cond) { assert(is != NULL); assert(plugin != NULL); @@ -33,8 +33,8 @@ input_stream_init(struct input_stream *is, const struct input_plugin *plugin, is->plugin = plugin; is->uri = g_strdup(uri); - is->mutex = mutex; - is->cond = cond; + is->mutex = &mutex; + is->cond = &cond; is->ready = false; is->seekable = false; is->size = -1; @@ -56,18 +56,16 @@ void input_stream_signal_client(struct input_stream *is) { if (is->cond != NULL) - g_cond_broadcast(is->cond); + is->cond->broadcast(); } void input_stream_set_ready(struct input_stream *is) { - g_mutex_lock(is->mutex); + const ScopeLock protect(*is->mutex); if (!is->ready) { is->ready = true; input_stream_signal_client(is); } - - g_mutex_unlock(is->mutex); } -- cgit v1.2.3