From 8465655ceac8e1f78e4af2224ed8b8839ec4a35e Mon Sep 17 00:00:00 2001 From: Yuqian Yang Date: Sun, 7 Sep 2025 21:46:34 +0800 Subject: Fix logger stop. --- include/cru/base/platform/unix/EventLoop.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'include/cru/base/platform/unix/EventLoop.h') 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 action, std::chrono::milliseconds timeout, bool repeat); + void CancelTimer(int id); int SetImmediate(std::function 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_; -- cgit v1.2.3