diff options
author | Max Kellermann <max@duempel.org> | 2008-08-26 08:27:17 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2008-08-26 08:27:17 +0200 |
commit | 7125fdc4f24176997e68e5e6923ca6df685cf159 (patch) | |
tree | 210cc840dd3ab67e9faee4a177e47872489cd39b | |
parent | f16869569991b17670654aa986cd2f564b519c34 (diff) | |
download | mpd-7125fdc4f24176997e68e5e6923ca6df685cf159.tar.gz mpd-7125fdc4f24176997e68e5e6923ca6df685cf159.tar.xz mpd-7125fdc4f24176997e68e5e6923ca6df685cf159.zip |
assert locked/unlocked in queue lock functions
There are no nested queue locks in mpd, thus replace the locked checks
in playerQueueLock(), playerQueueUnlock() with assertions.
-rw-r--r-- | src/player.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/player.c b/src/player.c index ba424d1d5..6a2c3a08e 100644 --- a/src/player.c +++ b/src/player.c @@ -190,14 +190,17 @@ void setQueueState(enum player_queue_state queueState) void playerQueueLock(void) { - if (pc.queueLockState == PLAYER_QUEUE_UNLOCKED) - player_command(PLAYER_COMMAND_LOCK_QUEUE); + assert(pc.queueLockState == PLAYER_QUEUE_UNLOCKED); + player_command(PLAYER_COMMAND_LOCK_QUEUE); + assert(pc.queueLockState == PLAYER_QUEUE_LOCKED); } void playerQueueUnlock(void) { if (pc.queueLockState == PLAYER_QUEUE_LOCKED) player_command(PLAYER_COMMAND_UNLOCK_QUEUE); + + assert(pc.queueLockState == PLAYER_QUEUE_UNLOCKED); } int playerSeek(int fd, Song * song, float seek_time) |