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

Method set_watchdog_handler

implementation/runtime/src/application_impl.cpp:2184–2197  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2182}
2183
2184void application_impl::set_watchdog_handler(const watchdog_handler_t& _handler, std::chrono::seconds _interval) {
2185 if (_handler && std::chrono::seconds::zero() != _interval) {
2186 std::scoped_lock its_lock{watchdog_timer_mutex_};
2187 watchdog_handler_ = _handler;
2188 watchdog_interval_ = _interval;
2189 watchdog_timer_.expires_after(_interval);
2190 watchdog_timer_.async_wait(std::bind(&application_impl::watchdog_cbk, this, std::placeholders::_1));
2191 } else {
2192 std::scoped_lock its_lock{watchdog_timer_mutex_};
2193 watchdog_timer_.cancel();
2194 watchdog_handler_ = nullptr;
2195 watchdog_interval_ = std::chrono::seconds::zero();
2196 }
2197}
2198
2199void application_impl::register_async_subscription_handler(service_t _service, instance_t _instance, eventgroup_t _eventgroup,
2200 const async_subscription_handler_t& _handler) {

Callers 1

TEST_FFunction · 0.80

Calls 3

expires_afterMethod · 0.45
async_waitMethod · 0.45
cancelMethod · 0.45

Tested by 1

TEST_FFunction · 0.64