aboutsummaryrefslogtreecommitdiff
path: root/src/PlayerThread.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2013-01-25 23:53:43 +0100
committerMax Kellermann <max@duempel.org>2013-01-25 23:53:43 +0100
commita9b62a2ece7f8b05bbb785edb47be8f37a19284e (patch)
tree690960bb7cc7a72b373b5182ebb9f7beff95d87c /src/PlayerThread.cxx
parent49567f1f3eab7ac04e4c3c818212e4e3cb437e0f (diff)
PlayerControl: add second Cond object
This fixes a deadlock bug introduced by 18076ac9. After all, the second Cond was necessary. The problem: two threads can wait for a signal at the same time. The player thread waits for the output thread to finish playback. The main thread waits for the player thread to complete a command. The output thread finishes playback, and sends a signal, which unfortunately does not wake up the player thread, but the main thread. The main thread sees that the command is still not finished, and waits again. The signal is lost forever, and MPD is deadlocked.
Diffstat (limited to 'src/PlayerThread.cxx')
-rw-r--r--src/PlayerThread.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/PlayerThread.cxx b/src/PlayerThread.cxx
index 23487953..ac2cb84b 100644
--- a/src/PlayerThread.cxx
+++ b/src/PlayerThread.cxx
@@ -147,7 +147,7 @@ player_command_finished_locked(struct player_control *pc)
assert(pc->command != PLAYER_COMMAND_NONE);
pc->command = PLAYER_COMMAND_NONE;
- pc->cond.signal();
+ pc->ClientSignal();
}
static void