aboutsummaryrefslogtreecommitdiff
path: root/include/cru/base/platform/unix/EventLoop.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/cru/base/platform/unix/EventLoop.h')
-rw-r--r--include/cru/base/platform/unix/EventLoop.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/cru/base/platform/unix/EventLoop.h b/include/cru/base/platform/unix/EventLoop.h
index 784cb780..9def8c7b 100644
--- a/include/cru/base/platform/unix/EventLoop.h
+++ b/include/cru/base/platform/unix/EventLoop.h
@@ -45,14 +45,17 @@ class UnixTimerFile : public Object2 {
};
class UnixEventLoop : public Object2 {
+ CRU_DEFINE_CLASS_LOG_TAG("cru::platform::unix::UnixEventLoop")
public:
UnixEventLoop();
+ ~UnixEventLoop() override;
int Run();
void RequestQuit(int exit_code = 0);
int SetTimer(std::function<void()> action, std::chrono::milliseconds timeout,
bool repeat);
+ void CancelTimer(int id);
int SetImmediate(std::function<void()> action) {
return this->SetTimer(std::move(action), std::chrono::milliseconds::zero(),
@@ -91,6 +94,8 @@ class UnixEventLoop : public Object2 {
bool CheckTimer();
bool ReadTimerPipe();
+ void RemoveTimer(int id);
+
private:
std::thread::id running_thread_;