| 73 | } |
| 74 | |
| 75 | void Timer::pollTimers() |
| 76 | { |
| 77 | // Generate messages for timers |
| 78 | if (!timers.empty()) { |
| 79 | base::tick_t t = base::current_tick(); |
| 80 | |
| 81 | for (Timers::iterator it=timers.begin(), end=timers.end(); it != end; ++it) { |
| 82 | Timer* timer = *it; |
| 83 | if (timer && timer->isRunning()) { |
| 84 | int64_t count = ((t - timer->m_lastTick) / timer->m_interval); |
| 85 | if (count > 0) { |
| 86 | timer->m_lastTick += count * timer->m_interval; |
| 87 | |
| 88 | ASSERT(timer->m_owner != nullptr); |
| 89 | |
| 90 | Message* msg = new TimerMessage(count, timer); |
| 91 | msg->addRecipient(timer->m_owner); |
| 92 | Manager::getDefault()->enqueueMessage(msg); |
| 93 | } |
| 94 | } |
| 95 | } |
| 96 | } |
| 97 | } |
| 98 | |
| 99 | void Timer::checkNoTimers() |
| 100 | { |
nothing calls this directly
no test coverage detected