diff options
author | Max Kellermann <max@duempel.org> | 2013-01-27 17:20:50 +0100 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2013-01-27 18:39:32 +0100 |
commit | 6f3d70b5e24cebbd6fd8c3a665a801628ef912ff (patch) | |
tree | 88ab67b76bac4b88422c3debe7c46d6168a71934 /src/InputInternal.cxx | |
parent | 257a0dee758049586efbf0dc3f0339b0cef03456 (diff) | |
download | mpd-6f3d70b5e24cebbd6fd8c3a665a801628ef912ff.tar.gz mpd-6f3d70b5e24cebbd6fd8c3a665a801628ef912ff.tar.xz mpd-6f3d70b5e24cebbd6fd8c3a665a801628ef912ff.zip |
DecoderControl, InputStream: use Mutex/Cond instead of GMutex/GCond
Diffstat (limited to '')
-rw-r--r-- | src/InputInternal.cxx | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/InputInternal.cxx b/src/InputInternal.cxx index 8fc4fa0a8..52ca4cf00 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); } |