MCPcopy
hub / github.com/aceld/zinx / CancelTimer

Method CancelTimer

ztimer/timerscheduler.go:83–92  ·  view source on GitHub ↗

CancelTimer 删除timer

(tID uint32)

Source from the content-addressed store, hash-verified

81
82// CancelTimer 删除timer
83func (ts *TimerScheduler) CancelTimer(tID uint32) {
84 ts.Lock()
85 defer ts.Unlock()
86
87 tw := ts.tw
88 for tw != nil {
89 tw.RemoveTimer(tID)
90 tw = tw.nextTimeWheel
91 }
92}
93
94// GetTriggerChan 获取计时结束的延迟执行函数通道
95func (ts *TimerScheduler) GetTriggerChan() chan *DelayFunc {

Callers 1

TestCancelTimerSchedulerFunction · 0.80

Calls 1

RemoveTimerMethod · 0.80

Tested by 1

TestCancelTimerSchedulerFunction · 0.64