*: use std::scoped_lock with implicit template parameter

This commit is contained in:
Max Kellermann
2024-05-23 20:43:31 +02:00
parent 4fc3230fe6
commit 381215fd73
68 changed files with 253 additions and 253 deletions

View File

@@ -71,7 +71,7 @@ QobuzClient::StartLogin()
void
QobuzClient::AddLoginHandler(QobuzSessionHandler &h) noexcept
{
const std::scoped_lock<Mutex> protect(mutex);
const std::scoped_lock protect{mutex};
assert(!h.is_linked());
const bool was_empty = handlers.empty();
@@ -98,7 +98,7 @@ QobuzClient::AddLoginHandler(QobuzSessionHandler &h) noexcept
QobuzSession
QobuzClient::GetSession() const
{
const std::scoped_lock<Mutex> protect(mutex);
const std::scoped_lock protect{mutex};
if (error)
std::rethrow_exception(error);
@@ -113,7 +113,7 @@ void
QobuzClient::OnQobuzLoginSuccess(QobuzSession &&_session) noexcept
{
{
const std::scoped_lock<Mutex> protect(mutex);
const std::scoped_lock protect{mutex};
session = std::move(_session);
login_request.reset();
}
@@ -125,7 +125,7 @@ void
QobuzClient::OnQobuzLoginError(std::exception_ptr _error) noexcept
{
{
const std::scoped_lock<Mutex> protect(mutex);
const std::scoped_lock protect{mutex};
error = std::move(_error);
login_request.reset();
}
@@ -136,7 +136,7 @@ QobuzClient::OnQobuzLoginError(std::exception_ptr _error) noexcept
void
QobuzClient::InvokeHandlers() noexcept
{
const std::scoped_lock<Mutex> protect(mutex);
const std::scoped_lock protect{mutex};
while (!handlers.empty()) {
auto &h = handlers.front();
handlers.pop_front();