thread/Mutex: remove ScopeLock, use std::lock_guard directly

This commit is contained in:
Max Kellermann
2017-01-03 07:11:57 +01:00
parent a42021655c
commit 2e182e84c3
51 changed files with 158 additions and 160 deletions

View File

@@ -109,12 +109,12 @@ MultipleOutputs::EnableDisable()
/* parallel execution */
for (auto ao : outputs) {
const ScopeLock lock(ao->mutex);
const std::lock_guard<Mutex> lock(ao->mutex);
ao->EnableDisableAsync();
}
for (auto ao : outputs) {
const ScopeLock lock(ao->mutex);
const std::lock_guard<Mutex> lock(ao->mutex);
ao->WaitForCommand();
}
}
@@ -123,7 +123,7 @@ bool
MultipleOutputs::AllFinished() const
{
for (auto ao : outputs) {
const ScopeLock protect(ao->mutex);
const std::lock_guard<Mutex> protect(ao->mutex);
if (ao->IsOpen() && !ao->IsCommandFinished())
return false;
}
@@ -215,7 +215,7 @@ MultipleOutputs::Open(const AudioFormat audio_format,
std::exception_ptr first_error;
for (auto ao : outputs) {
const ScopeLock lock(ao->mutex);
const std::lock_guard<Mutex> lock(ao->mutex);
if (ao->IsEnabled())
enabled = true;