{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.
This commit is contained in:
Max Kellermann
2009-11-02 17:12:00 +01:00
parent 93d8f9f00e
commit 64a481d873
3 changed files with 5 additions and 7 deletions
+2 -3
View File
@@ -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();
}