aboutsummaryrefslogtreecommitdiff
path: root/include/cru/base/platform
diff options
context:
space:
mode:
authorYuqian Yang <crupest@crupest.life>2025-09-07 21:46:34 +0800
committerYuqian Yang <crupest@crupest.life>2025-09-07 21:46:34 +0800
commit8465655ceac8e1f78e4af2224ed8b8839ec4a35e (patch)
tree265499f3c4a46c06a48082e06210e6dbf416972e /include/cru/base/platform
parentd36ed6c52f679ad0f9a0e89a4e1d09b763f063b8 (diff)
downloadcru-8465655ceac8e1f78e4af2224ed8b8839ec4a35e.tar.gz
cru-8465655ceac8e1f78e4af2224ed8b8839ec4a35e.tar.bz2
cru-8465655ceac8e1f78e4af2224ed8b8839ec4a35e.zip
Fix logger stop.
Diffstat (limited to 'include/cru/base/platform')
-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_;