| 56 | } |
| 57 | |
| 58 | void 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 |
| 71 | void TimerQueue::resetTimerfd(int timerfd_, Timestamp expiration) |
nothing calls this directly
no test coverage detected