*: use std::scoped_lock with implicit template parameter
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user