MCPcopy Create free account
hub / github.com/DFHack/dfhack / dfhack_crashlog_shutdown

Function dfhack_crashlog_shutdown

library/Crashlog.cpp:173–189  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

171 }
172
173 void dfhack_crashlog_shutdown() {
174 shutdown.exchange(true);
175 for (int signal : desired_signals) {
176 std::signal(signal, SIG_DFL);
177 }
178 std::set_terminate(term_handler);
179
180 // Shutdown the crashlog thread.
181 flag_set(crashlog_ready);
182 crashlog_thread.join();
183
184 // If the signal handler is somehow running whilst here, let it terminate
185 signal_crashlog_complete();
186 if (crashlog_complete != -1)
187 close(crashlog_complete); // Close fd
188 return;
189 }
190}

Callers 1

ShutdownMethod · 0.85

Calls 2

flag_setFunction · 0.85
signal_crashlog_completeFunction · 0.85

Tested by

no test coverage detected