Skip to content

Commit

Permalink
event/Loop: use std::scoped_lock with implicit template parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxKellermann committed May 23, 2024
1 parent 64bdaa4 commit 4fc3230
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/event/Loop.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ EventLoop::Run() noexcept
/* try to handle DeferEvents without WakeFD
overhead */
{
const std::scoped_lock<Mutex> lock(mutex);
const std::scoped_lock lock{mutex};
HandleInject();
#endif

Expand All @@ -349,7 +349,7 @@ EventLoop::Run() noexcept

#ifdef HAVE_THREADED_EVENT_LOOP
{
const std::scoped_lock<Mutex> lock(mutex);
const std::scoped_lock lock{mutex};
busy = true;
}
#endif
Expand Down Expand Up @@ -381,7 +381,7 @@ EventLoop::AddInject(InjectEvent &d) noexcept
bool must_wake;

{
const std::scoped_lock<Mutex> lock(mutex);
const std::scoped_lock lock{mutex};
if (d.IsPending())
return;

Expand All @@ -400,7 +400,7 @@ EventLoop::AddInject(InjectEvent &d) noexcept
void
EventLoop::RemoveInject(InjectEvent &d) noexcept
{
const std::scoped_lock<Mutex> protect(mutex);
const std::scoped_lock protect{mutex};

if (d.IsPending())
inject.erase(inject.iterator_to(d));
Expand Down Expand Up @@ -432,7 +432,7 @@ EventLoop::OnSocketReady([[maybe_unused]] unsigned flags) noexcept
return;
}

const std::scoped_lock<Mutex> lock(mutex);
const std::scoped_lock lock{mutex};
HandleInject();
}

Expand Down

0 comments on commit 4fc3230

Please sign in to comment.