aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2011-07-20 18:50:30 +0200
committerMax Kellermann <max@duempel.org>2011-07-20 19:05:32 +0200
commita26f2ef17df9a741ba759b31a3d6f5a8f7068b6d (patch)
tree294e62ff36a47adf279c5ea37895b881c71fada9
parentd97c46bcdc60e91d3ac4700bfebc39092d65452e (diff)
downloadmpd-a26f2ef17df9a741ba759b31a3d6f5a8f7068b6d.tar.gz
mpd-a26f2ef17df9a741ba759b31a3d6f5a8f7068b6d.tar.xz
mpd-a26f2ef17df9a741ba759b31a3d6f5a8f7068b6d.zip
pipe: lock the mutex in music_pipe_size()
-rw-r--r--src/pipe.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/pipe.c b/src/pipe.c
index 7e4b0d081..2f5f70e43 100644
--- a/src/pipe.c
+++ b/src/pipe.c
@@ -187,5 +187,8 @@ music_pipe_push(struct music_pipe *mp, struct music_chunk *chunk)
unsigned
music_pipe_size(const struct music_pipe *mp)
{
- return mp->size;
+ g_mutex_lock(mp->mutex);
+ unsigned size = mp->size;
+ g_mutex_unlock(mp->mutex);
+ return size;
}