From f0e28ede4da3da8754f48ef5af1b654792e3364c Mon Sep 17 00:00:00 2001
From: Max Kellermann <max@duempel.org>
Date: Sat, 12 Apr 2008 04:16:50 +0000
Subject: fix deadlock at end of song

Now that we do proper locking and signalling instead of continuous
polling for IPC, a deadlock was found: at the end of a song, the
player thread waits until the main thread sets pc->queueState from
PLAYER_QUEUE_DECODE to PLAYER_QUEUE_PLAY.  He is never woken up, since
syncPlaylistWithQueue() does not activate the notification.  I added
wakeup_player_nb() to setQueueState(), since the player must be
signalled whenever pc->queueState changes.

git-svn-id: https://svn.musicpd.org/mpd/trunk@7303 09075e82-0dd4-0310-85a5-a0d7c8717e4f
---
 src/player.c | 1 +
 1 file changed, 1 insertion(+)

(limited to 'src')

diff --git a/src/player.c b/src/player.c
index 07c074060..5ef35f214 100644
--- a/src/player.c
+++ b/src/player.c
@@ -281,6 +281,7 @@ void setQueueState(int queueState)
 	PlayerControl *pc = &(getPlayerData()->playerControl);
 
 	pc->queueState = queueState;
+	wakeup_player_nb();
 }
 
 void playerQueueLock(void)
-- 
cgit v1.2.3