lib/curl/Init: use std::scoped_lock with implicit template parameter

This commit is contained in:
Max Kellermann
2024-05-23 20:44:05 +02:00
parent 6e16eaebba
commit 64bdaa46fb

View File

@@ -15,7 +15,7 @@ CurlGlobal *CurlInit::instance;
CurlInit::CurlInit(EventLoop &event_loop) CurlInit::CurlInit(EventLoop &event_loop)
{ {
const std::scoped_lock<Mutex> protect(mutex); const std::scoped_lock protect{mutex};
if (++ref > 1) { if (++ref > 1) {
assert(&event_loop == &instance->GetEventLoop()); assert(&event_loop == &instance->GetEventLoop());
return; return;
@@ -31,7 +31,7 @@ CurlInit::CurlInit(EventLoop &event_loop)
CurlInit::~CurlInit() noexcept CurlInit::~CurlInit() noexcept
{ {
const std::scoped_lock<Mutex> protect(mutex); const std::scoped_lock protect{mutex};
if (--ref > 0) if (--ref > 0)
return; return;