| 19 | #include "boxedwine.h" |
| 20 | |
| 21 | bool KRunTimer::run() { |
| 22 | BOXEDWINE_CRITICAL_SECTION_WITH_CONDITION(timer->waitCond); |
| 23 | timer->numberOfExpirations++; |
| 24 | BOXEDWINE_CONDITION_SIGNAL_ALL(timer->waitCond); |
| 25 | if (!timer->microInterval) { |
| 26 | return true; // remove timer |
| 27 | } else { |
| 28 | U64 now = KSystem::getSystemTimeAsMicroSeconds(); |
| 29 | timer->microNextTimer = now + timer->microInterval; |
| 30 | this->millies = (U32)(timer->microInterval / 1000) + KSystem::getMilliesSinceStart(); |
| 31 | return false; // keep timer going |
| 32 | } |
| 33 | } |
| 34 | |
| 35 | KTimerCallback::~KTimerCallback() { |
| 36 | if (this->active) { |
no outgoing calls