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

Method remove_elapsed_dispatchers

implementation/runtime/src/application_impl.cpp:1852–1876  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1850}
1851
1852void application_impl::remove_elapsed_dispatchers(std::unique_lock<std::mutex>& _lock) {
1853 std::vector<std::shared_ptr<std::thread>> elapsed;
1854 if (!is_dispatching_) {
1855 return;
1856 }
1857 for (auto id : elapsed_dispatchers_) {
1858 auto it = dispatchers_.find(id);
1859 if (it != dispatchers_.end()) {
1860 elapsed.push_back(it->second);
1861 dispatchers_.erase(it);
1862 }
1863 }
1864 elapsed_dispatchers_.clear();
1865
1866 for (auto& dispatcher : elapsed) {
1867 const auto id = dispatcher->get_id();
1868 VSOMEIP_INFO << "Joining dispatcher thread. client=" << hex4(client_) << " id=" << std::hex << id;
1869 _lock.unlock();
1870 if (dispatcher->joinable()) {
1871 dispatcher->join();
1872 }
1873 _lock.lock();
1874 VSOMEIP_INFO << "Joined dispatcher thread. client=" << hex4(client_) << " id=" << std::hex << id;
1875 }
1876}
1877
1878void application_impl::clear_all_handler() {
1879 unregister_state_handler();

Callers

nothing calls this directly

Calls 7

hex4Function · 0.85
endMethod · 0.80
unlockMethod · 0.80
lockMethod · 0.80
clearMethod · 0.45
get_idMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected