Merge remote-tracking branches 'neheb/1', 'neheb/2', 'neheb/3', 'neheb/4' and 'neheb/5'
This commit is contained in:
@@ -68,7 +68,7 @@ private:
|
||||
exception = std::current_exception();
|
||||
}
|
||||
|
||||
const std::lock_guard<Mutex> lock(mutex);
|
||||
const std::scoped_lock<Mutex> lock(mutex);
|
||||
done = true;
|
||||
cond.notify_one();
|
||||
}
|
||||
|
||||
@@ -323,7 +323,7 @@ EventLoop::Run() noexcept
|
||||
/* try to handle DeferEvents without WakeFD
|
||||
overhead */
|
||||
{
|
||||
const std::lock_guard<Mutex> lock(mutex);
|
||||
const std::scoped_lock<Mutex> lock(mutex);
|
||||
HandleInject();
|
||||
#endif
|
||||
|
||||
@@ -346,7 +346,7 @@ EventLoop::Run() noexcept
|
||||
|
||||
#ifdef HAVE_THREADED_EVENT_LOOP
|
||||
{
|
||||
const std::lock_guard<Mutex> lock(mutex);
|
||||
const std::scoped_lock<Mutex> lock(mutex);
|
||||
busy = true;
|
||||
}
|
||||
#endif
|
||||
@@ -378,7 +378,7 @@ EventLoop::AddInject(InjectEvent &d) noexcept
|
||||
bool must_wake;
|
||||
|
||||
{
|
||||
const std::lock_guard<Mutex> lock(mutex);
|
||||
const std::scoped_lock<Mutex> lock(mutex);
|
||||
if (d.IsPending())
|
||||
return;
|
||||
|
||||
@@ -397,7 +397,7 @@ EventLoop::AddInject(InjectEvent &d) noexcept
|
||||
void
|
||||
EventLoop::RemoveInject(InjectEvent &d) noexcept
|
||||
{
|
||||
const std::lock_guard<Mutex> protect(mutex);
|
||||
const std::scoped_lock<Mutex> protect(mutex);
|
||||
|
||||
if (d.IsPending())
|
||||
inject.erase(inject.iterator_to(d));
|
||||
@@ -424,7 +424,7 @@ EventLoop::OnSocketReady([[maybe_unused]] unsigned flags) noexcept
|
||||
|
||||
wake_fd.Read();
|
||||
|
||||
const std::lock_guard<Mutex> lock(mutex);
|
||||
const std::scoped_lock<Mutex> lock(mutex);
|
||||
HandleInject();
|
||||
}
|
||||
|
||||
|
||||
@@ -91,7 +91,7 @@ public:
|
||||
}
|
||||
#endif
|
||||
|
||||
bool IsDefined() const noexcept {
|
||||
[[nodiscard]] bool IsDefined() const noexcept {
|
||||
return event.IsDefined();
|
||||
}
|
||||
|
||||
|
||||
@@ -62,7 +62,7 @@ public:
|
||||
#endif
|
||||
}
|
||||
|
||||
auto &GetEventLoop() const noexcept {
|
||||
[[nodiscard]] auto &GetEventLoop() const noexcept {
|
||||
return event.GetEventLoop();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user