| 1367 | } |
| 1368 | |
| 1369 | void application_impl::on_state(state_type_e _state) { |
| 1370 | |
| 1371 | bool has_state_handler(false); |
| 1372 | state_handler_t handler = nullptr; |
| 1373 | { |
| 1374 | std::scoped_lock its_lock{state_handler_mutex_}; |
| 1375 | if (handler_) { |
| 1376 | has_state_handler = true; |
| 1377 | handler = handler_; |
| 1378 | } |
| 1379 | } |
| 1380 | if (has_state_handler) { |
| 1381 | std::scoped_lock its_lock{handlers_mutex_}; |
| 1382 | auto its_sync_handler = std::make_shared<sync_handler>([handler, _state]() { handler(_state); }); |
| 1383 | its_sync_handler->handler_type_ = handler_type_e::STATE; |
| 1384 | handlers_.push_back(its_sync_handler); |
| 1385 | dispatcher_condition_.notify_all(); |
| 1386 | } |
| 1387 | } |
| 1388 | |
| 1389 | availability_state_e application_impl::get_availability_state(const availability_state_t& _availability_state, service_t _service, |
| 1390 | instance_t _instance, major_version_t _major, minor_version_t _minor) const { |
no outgoing calls
no test coverage detected