Commit 947856ca authored by Max Kellermann's avatar Max Kellermann

event/Loop: forward-declare class TimerEvent

parent cd9ff9d9
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
*/ */
#include "Loop.hxx" #include "Loop.hxx"
#include "TimerEvent.hxx"
#include "SocketMonitor.hxx" #include "SocketMonitor.hxx"
#include "IdleMonitor.hxx" #include "IdleMonitor.hxx"
#include "DeferEvent.hxx" #include "DeferEvent.hxx"
...@@ -29,6 +30,13 @@ ...@@ -29,6 +30,13 @@
#include <stdio.h> #include <stdio.h>
#endif #endif
constexpr bool
EventLoop::TimerCompare::operator()(const TimerEvent &a,
const TimerEvent &b) const noexcept
{
return a.due < b.due;
}
EventLoop::EventLoop(ThreadId _thread) EventLoop::EventLoop(ThreadId _thread)
:SocketMonitor(*this), :SocketMonitor(*this),
/* if this instance is hosted by an EventThread (no ThreadId /* if this instance is hosted by an EventThread (no ThreadId
......
...@@ -27,7 +27,6 @@ ...@@ -27,7 +27,6 @@
#include "thread/Mutex.hxx" #include "thread/Mutex.hxx"
#include "WakeFD.hxx" #include "WakeFD.hxx"
#include "SocketMonitor.hxx" #include "SocketMonitor.hxx"
#include "TimerEvent.hxx"
#include "IdleMonitor.hxx" #include "IdleMonitor.hxx"
#include "DeferEvent.hxx" #include "DeferEvent.hxx"
...@@ -44,6 +43,8 @@ ...@@ -44,6 +43,8 @@
namespace Uring { class Queue; class Manager; } namespace Uring { class Queue; class Manager; }
#endif #endif
class TimerEvent;
/** /**
* An event loop that polls for events on file/socket descriptors. * An event loop that polls for events on file/socket descriptors.
* *
...@@ -59,9 +60,7 @@ class EventLoop final : SocketMonitor ...@@ -59,9 +60,7 @@ class EventLoop final : SocketMonitor
struct TimerCompare { struct TimerCompare {
constexpr bool operator()(const TimerEvent &a, constexpr bool operator()(const TimerEvent &a,
const TimerEvent &b) const { const TimerEvent &b) const noexcept;
return a.due < b.due;
}
}; };
using TimerSet = using TimerSet =
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment