| 98 | } |
| 99 | |
| 100 | void timer::handle(boost::system::error_code const& _ec) { |
| 101 | if (_ec == boost::asio::error::operation_aborted) { |
| 102 | return; |
| 103 | } |
| 104 | std::unique_lock lock{mtx_}; |
| 105 | if (state_ != state_e::STARTED) { |
| 106 | VSOMEIP_DEBUG_P << "Not executing the task: " << this; |
| 107 | return; |
| 108 | } |
| 109 | state_ = state_e::IN_TASK; |
| 110 | lock.unlock(); |
| 111 | bool const restart = task_(); |
| 112 | lock.lock(); |
| 113 | if (state_ == state_e::IN_TASK_STARTED || (restart && state_ == state_e::IN_TASK)) { |
| 114 | start_unlocked(); |
| 115 | return; |
| 116 | } |
| 117 | state_ = state_e::STOPPED; |
| 118 | } |
| 119 | } |
no test coverage detected