aboutsummaryrefslogtreecommitdiffstats
path: root/src/player_control.c
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-11-02 17:12:00 +0100
committerMax Kellermann <max@duempel.org>2009-11-02 17:12:00 +0100
commit64a481d8732cc45b01b70d18cf95e1374b7dcba7 (patch)
tree5be1cb521897d47d2cdbcfbb7ae068b154ab2d5a /src/player_control.c
parent93d8f9f00e838b4b0054ea6487d8810bfa60628d (diff)
downloadmpd-64a481d8732cc45b01b70d18cf95e1374b7dcba7.tar.gz
mpd-64a481d8732cc45b01b70d18cf95e1374b7dcba7.tar.xz
mpd-64a481d8732cc45b01b70d18cf95e1374b7dcba7.zip
{decoder,player}_control: removed duplicate wakeups
Don't wake up the target thread in every iteration of the wait() loop. Waking it up once, right after the command has been set, must be enough.
Diffstat (limited to '')
-rw-r--r--src/player_control.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/player_control.c b/src/player_control.c
index 42dc9e1c0..1828a1ca0 100644
--- a/src/player_control.c
+++ b/src/player_control.c
@@ -72,10 +72,8 @@ pc_song_deleted(const struct song *song)
static void
player_command_wait_locked(void)
{
- while (pc.command != PLAYER_COMMAND_NONE) {
- player_signal();
+ while (pc.command != PLAYER_COMMAND_NONE)
g_cond_wait(main_cond, pc.mutex);
- }
}
static void
@@ -84,6 +82,7 @@ player_command_locked(enum player_command cmd)
assert(pc.command == PLAYER_COMMAND_NONE);
pc.command = cmd;
+ player_signal();
player_command_wait_locked();
}