From cd38d3a5ff77831d675fd7accd90a38992a294c8 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Wed, 11 Dec 2019 14:42:08 +0800 Subject: [PATCH] 1 --- a8/timer.cc | 8 ++++++++ a8/timer.h | 1 + 2 files changed, 9 insertions(+) diff --git a/a8/timer.cc b/a8/timer.cc index 9a2585c..dcb2082 100644 --- a/a8/timer.cc +++ b/a8/timer.cc @@ -251,6 +251,14 @@ namespace a8 return &timer->param; } + void Timer::RemoveTimerFunc(timer_list* timer) + { + if (!timer) { + abort(); + } + timer->timer_after_func = nullptr; + } + long long Timer::GetRemainTime(timer_list* timer) { if (!timer) { diff --git a/a8/timer.h b/a8/timer.h index fc5b5fe..a50e7d6 100644 --- a/a8/timer.h +++ b/a8/timer.h @@ -42,6 +42,7 @@ namespace a8 timer_list* GetTimerByAttach(list_head* attach_entry); //获取定时器关联参数 a8::XParams* MutableParams(timer_list* timer); + void RemoveTimerFunc(timer_list* timer); //获取定时器剩余时间 long long GetRemainTime(timer_list* timer); //获取当前正在运行的定时器