event/Loop: use std::scoped_lock with implicit template parameter
This commit is contained in:
parent
64bdaa46fb
commit
4fc3230fe6
|
@ -326,7 +326,7 @@ EventLoop::Run() noexcept
|
||||||
/* try to handle DeferEvents without WakeFD
|
/* try to handle DeferEvents without WakeFD
|
||||||
overhead */
|
overhead */
|
||||||
{
|
{
|
||||||
const std::scoped_lock<Mutex> lock(mutex);
|
const std::scoped_lock lock{mutex};
|
||||||
HandleInject();
|
HandleInject();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -349,7 +349,7 @@ EventLoop::Run() noexcept
|
||||||
|
|
||||||
#ifdef HAVE_THREADED_EVENT_LOOP
|
#ifdef HAVE_THREADED_EVENT_LOOP
|
||||||
{
|
{
|
||||||
const std::scoped_lock<Mutex> lock(mutex);
|
const std::scoped_lock lock{mutex};
|
||||||
busy = true;
|
busy = true;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -381,7 +381,7 @@ EventLoop::AddInject(InjectEvent &d) noexcept
|
||||||
bool must_wake;
|
bool must_wake;
|
||||||
|
|
||||||
{
|
{
|
||||||
const std::scoped_lock<Mutex> lock(mutex);
|
const std::scoped_lock lock{mutex};
|
||||||
if (d.IsPending())
|
if (d.IsPending())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -400,7 +400,7 @@ EventLoop::AddInject(InjectEvent &d) noexcept
|
||||||
void
|
void
|
||||||
EventLoop::RemoveInject(InjectEvent &d) noexcept
|
EventLoop::RemoveInject(InjectEvent &d) noexcept
|
||||||
{
|
{
|
||||||
const std::scoped_lock<Mutex> protect(mutex);
|
const std::scoped_lock protect{mutex};
|
||||||
|
|
||||||
if (d.IsPending())
|
if (d.IsPending())
|
||||||
inject.erase(inject.iterator_to(d));
|
inject.erase(inject.iterator_to(d));
|
||||||
|
@ -432,7 +432,7 @@ EventLoop::OnSocketReady([[maybe_unused]] unsigned flags) noexcept
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const std::scoped_lock<Mutex> lock(mutex);
|
const std::scoped_lock lock{mutex};
|
||||||
HandleInject();
|
HandleInject();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue