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.
This commit is contained in:
Max Kellermann 2008-08-26 08:27:17 +02:00
parent f168695699
commit 7125fdc4f2

View File

@ -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)