MCPcopy Create free account
hub / github.com/Shangyizhou/A-Tiny-Network-Library / addTimerInLoop

Method addTimerInLoop

src/timer/TimerQueue.cc:58–68  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

56}
57
58void TimerQueue::addTimerInLoop(Timer* timer)
59{
60 // 是否取代了最早的定时触发时间
61 bool eraliestChanged = insert(timer);
62
63 // 我们需要重新设置timerfd_触发时间
64 if (eraliestChanged)
65 {
66 resetTimerfd(timerfd_, timer->expiration());
67 }
68}
69
70// 重置timerfd
71void TimerQueue::resetTimerfd(int timerfd_, Timestamp expiration)

Callers

nothing calls this directly

Calls 2

insertFunction · 0.85
expirationMethod · 0.45

Tested by

no test coverage detected