mirror of
https://github.com/zeek/zeek.git
synced 2025-10-12 11:38:20 +00:00
util: Fix terminate_processing() called from non-main thread
The current raise(SIGTERM) sends a signal to the calling thread. If terminate_processing() is called from a non-main thread and that thread was created at InitPostScript() time when SIGTERM is blocked, or has blocked SIGTERM manually, terminate_processing() has no effect. Switching to kill(getpid(), SIGTERM) guarantees that a thread that doesn't block the signal (minimally the main thread) will run the handler.
This commit is contained in:
parent
574514b04c
commit
679575d6b2
1 changed files with 1 additions and 1 deletions
|
@ -830,7 +830,7 @@ double calc_next_rotate(double current, double interval, double base) {
|
|||
|
||||
void terminate_processing() {
|
||||
if ( ! run_state::terminating )
|
||||
raise(SIGTERM);
|
||||
kill(getpid(), SIGTERM);
|
||||
}
|
||||
|
||||
void set_processing_status(const char* status, const char* reason) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue