diff options
| author | Yuqian Yang <crupest@crupest.life> | 2025-09-07 21:46:34 +0800 |
|---|---|---|
| committer | Yuqian Yang <crupest@crupest.life> | 2025-09-07 21:46:34 +0800 |
| commit | 8465655ceac8e1f78e4af2224ed8b8839ec4a35e (patch) | |
| tree | 265499f3c4a46c06a48082e06210e6dbf416972e /include/cru/base/platform/unix | |
| parent | d36ed6c52f679ad0f9a0e89a4e1d09b763f063b8 (diff) | |
| download | cru-8465655ceac8e1f78e4af2224ed8b8839ec4a35e.tar.gz cru-8465655ceac8e1f78e4af2224ed8b8839ec4a35e.tar.bz2 cru-8465655ceac8e1f78e4af2224ed8b8839ec4a35e.zip | |
Fix logger stop.
Diffstat (limited to 'include/cru/base/platform/unix')
| -rw-r--r-- | include/cru/base/platform/unix/EventLoop.h | 5 |
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_; |
