PlayerThread: move code to player_control::CommandFinished()

This commit is contained in:
Max Kellermann
2013-09-27 07:58:48 +02:00
parent b6a5d1ad5a
commit ada67a6a4f
2 changed files with 26 additions and 21 deletions

View File

@@ -228,6 +228,20 @@ struct player_control {
client_cond.wait(mutex);
}
/**
* A command has been finished. This method clears the
* command and signals the client.
*
* To be called from the player thread. Caller must lock the
* object.
*/
void CommandFinished() {
assert(command != PLAYER_COMMAND_NONE);
command = PLAYER_COMMAND_NONE;
ClientSignal();
}
/**
* @param song the song to be queued; the given instance will
* be owned and freed by the player