resetIdleTimerLocked resets the idle timer to the given duration. Called when exiting idle mode or when the timer fires and we need to reset it.
(d time.Duration)
| 83 | // resetIdleTimerLocked resets the idle timer to the given duration. Called |
| 84 | // when exiting idle mode or when the timer fires and we need to reset it. |
| 85 | func (m *Manager) resetIdleTimerLocked(d time.Duration) { |
| 86 | if m.isClosed() || m.timeout == 0 || m.actuallyIdle { |
| 87 | return |
| 88 | } |
| 89 | |
| 90 | // It is safe to ignore the return value from Reset() because this method is |
| 91 | // only ever called from the timer callback or when exiting idle mode. |
| 92 | if m.timer != nil { |
| 93 | m.timer.Stop() |
| 94 | } |
| 95 | m.timer = timeAfterFunc(d, m.handleIdleTimeout) |
| 96 | } |
| 97 | |
| 98 | func (m *Manager) resetIdleTimer(d time.Duration) { |
| 99 | m.idleMu.Lock() |
no test coverage detected