mirror of
https://github.com/KjellKod/g3log.git
synced 2024-12-12 10:23:50 +01:00
exitWithDefaultSignalHandler() should block until signal handler returns (#464)
raise() system call does the same as kill() system call in a single-threaded program. In a multithreaded program, it does the same as pthread_kill() which ensures that if the signal causes a handler to be called, raise() will return only after the signal handler has returned.
This commit is contained in:
parent
21195751be
commit
0c09462e4d
@ -230,7 +230,7 @@ namespace g3 {
|
||||
std::cerr << "\n\n" << __FUNCTION__ << ":" << __LINE__ << ". Exiting due to " << level.text << ", " << signal_number << " \n\n" << std::flush;
|
||||
|
||||
|
||||
kill(getpid(), signal_number);
|
||||
raise(signal_number);
|
||||
|
||||
// When running as PID1 the above kill doesn't have any effect (execution simply passes through it, contrary
|
||||
// to a non-PID1 process where execution stops at kill and switches over to signal handling). Also as PID1
|
||||
|
Loading…
Reference in New Issue
Block a user