MCPcopy Create free account
hub / github.com/COVESA/vsomeip / start

Method start

implementation/endpoints/src/timer.cpp:30–44  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

28}
29
30void timer::start() {
31 std::scoped_lock lock{mtx_};
32 if (is_value(state_).none_of(state_e::STOPPED, state_e::IN_TASK_STOPPED)) {
33 // the timer is already running -> restart it
34 stop_unlocked();
35 }
36 if (is_value(state_).any_of(state_e::IN_TASK, state_e::IN_TASK_STARTED, state_e::IN_TASK_STOPPED)) {
37 // the timer is currently executing the task
38 // -> adjust the state but don't do anything, as it will be restarted after being done with
39 // the task
40 state_ = state_e::IN_TASK_STARTED;
41 return;
42 }
43 start_unlocked();
44}
45
46void timer::stop() {
47 std::scoped_lock lock{mtx_};

Callers 1

restartMethod · 0.45

Calls 3

is_valueClass · 0.85
none_ofMethod · 0.80
any_ofMethod · 0.80

Tested by

no test coverage detected