MCPcopy Create free account
hub / github.com/Niko1221/Strata / dump_thread_stacks

Function dump_thread_stacks

engine/src/kernels/cpu/pool.cpp:57–67  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

55 backtrace_symbols_fd(frames, n, 2);
56}
57void dump_thread_stacks(std::vector<std::thread>& threads) {
58 struct sigaction sa{};
59 sa.sa_handler = stall_stack_handler;
60 sigemptyset(&sa.sa_mask);
61 if (sigaction(SIGUSR2, &sa, nullptr) != 0) return;
62 for (auto& t : threads) {
63 if (!t.joinable()) continue;
64 pthread_kill(t.native_handle(), SIGUSR2);
65 usleep(150000); // one thread at a time: the handlers' lines do not mix
66 }
67}
68#else
69void dump_thread_stacks(std::vector<std::thread>&) {}
70#endif

Callers 2

wait_parkedMethod · 0.85
wait_doneMethod · 0.85

Calls 1

sigactionClass · 0.70

Tested by

no test coverage detected