decoder/Control: use ScopeLock

This commit is contained in:
Max Kellermann
2015-12-31 13:45:10 +01:00
parent ef260377c3
commit 2939fadd6a
2 changed files with 13 additions and 27 deletions

View File

@@ -90,7 +90,7 @@ DecoderControl::Start(DetachedSong *_song,
void
DecoderControl::Stop()
{
Lock();
const ScopeLock protect(mutex);
if (command != DecoderCommand::NONE)
/* Attempt to cancel the current command. If it's too
@@ -101,8 +101,6 @@ DecoderControl::Stop()
if (state != DecoderState::STOP && state != DecoderState::ERROR)
SynchronousCommandLocked(DecoderCommand::STOP);
Unlock();
}
bool