MCPcopy Create free account
hub / github.com/COVESA/vsomeip / ~thread_manager

Method ~thread_manager

implementation/thread_manager/src/thread_manager.cpp:11–27  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9namespace vsomeip_v3 {
10
11thread_manager::~thread_manager() {
12 std::scoped_lock its_lock{thread_mutex_};
13 for (auto& thread : thread_vector_) {
14 try {
15 if (thread->get_id() == std::this_thread::get_id()) {
16 fprintf(stderr, "Unable to join dispatcher thread: dispatcher thread called exit after stopping application\n");
17 fprintf(stderr, "Detaching dispatcher thread (WILL CAUSE LEAKS!)\n");
18 thread->detach();
19 continue;
20 }
21
22 thread->join();
23 } catch (const std::system_error& e) {
24 fprintf(stderr, "error: While trying to join a detached thread: %s\n", e.what());
25 }
26 }
27}
28
29thread_manager* thread_manager::get() {
30 // Use flag set by a custom deleter as a safety check in case something tries to save a thread during

Callers

nothing calls this directly

Calls 4

get_idFunction · 0.85
detachMethod · 0.80
get_idMethod · 0.45
joinMethod · 0.45

Tested by

no test coverage detected