| 75 | } |
| 76 | |
| 77 | void |
| 78 | AsyncTimer::run() |
| 79 | { |
| 80 | state_->dispatch_controller_ = getDispatchController(); // keep a copy in state so that cont handler can use it |
| 81 | int one_off_timeout_in_ms = 0; |
| 82 | int regular_timeout_in_ms = 0; |
| 83 | if (state_->type_ == AsyncTimer::TYPE_ONE_OFF) { |
| 84 | one_off_timeout_in_ms = state_->period_in_ms_; |
| 85 | } else { |
| 86 | one_off_timeout_in_ms = state_->initial_period_in_ms_; |
| 87 | regular_timeout_in_ms = state_->period_in_ms_; |
| 88 | } |
| 89 | if (one_off_timeout_in_ms) { |
| 90 | LOG_DEBUG("Scheduling initial/one-off event"); |
| 91 | state_->initial_timer_action_ = TSContScheduleOnPool(state_->cont_, one_off_timeout_in_ms, state_->thread_pool_); |
| 92 | } else if (regular_timeout_in_ms) { |
| 93 | LOG_DEBUG("Scheduling regular timer events"); |
| 94 | state_->periodic_timer_action_ = TSContScheduleEveryOnPool(state_->cont_, regular_timeout_in_ms, state_->thread_pool_); |
| 95 | } |
| 96 | } |
| 97 | |
| 98 | void |
| 99 | AsyncTimer::cancel() |
nothing calls this directly
no test coverage detected