mirror of
https://github.com/zeek/zeek.git
synced 2025-10-03 23:28:20 +00:00
Improved signal handling.
Sending SIGTERM triggers a normal shutdown of all threads that waits until they have processed their remaining data. However, sending a 2nd SIGTERM while waiting for them to finish will immediately kill them all.
This commit is contained in:
parent
ffb4094d36
commit
4879cb7b0d
5 changed files with 56 additions and 0 deletions
|
@ -113,6 +113,17 @@ void BasicThread::Join()
|
|||
pthread = 0;
|
||||
}
|
||||
|
||||
void BasicThread::Kill()
|
||||
{
|
||||
if ( ! (started && pthread) )
|
||||
return;
|
||||
|
||||
// I believe this is safe to call from a signal handler ... Not error
|
||||
// checking so that killing doesn't bail out if we have already
|
||||
// terminated.
|
||||
pthread_kill(pthread, SIGKILL);
|
||||
}
|
||||
|
||||
void* BasicThread::launcher(void *arg)
|
||||
{
|
||||
BasicThread* thread = (BasicThread *)arg;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue