mirror of
https://github.com/zeek/zeek.git
synced 2025-10-04 15:48:19 +00:00
Changing semantics of thread stop methods.
PrepareStop() is now SignalStop() and just signals a thread that it should terminate. After that's called, WaitForStop() (formerly Stop()) wait for it to actually finish processing. When stopping writers during operation, we now no longer wait for them to finish.
This commit is contained in:
parent
38e1dc9ca4
commit
d11bd56b5d
6 changed files with 45 additions and 44 deletions
|
@ -161,16 +161,16 @@ MsgThread::MsgThread() : BasicThread(), queue_in(this, 0), queue_out(0, this)
|
|||
// Set by Bro's main signal handler.
|
||||
extern int signal_val;
|
||||
|
||||
void MsgThread::OnPrepareStop()
|
||||
void MsgThread::OnSignalStop()
|
||||
{
|
||||
if ( finished || Killed() )
|
||||
return;
|
||||
|
||||
// Signal thread to terminate and wait until it has acknowledged.
|
||||
// Signal thread to terminate.
|
||||
SendIn(new FinishMessage(this, network_time), true);
|
||||
}
|
||||
|
||||
void MsgThread::OnStop()
|
||||
void MsgThread::OnWaitForStop()
|
||||
{
|
||||
int signal_count = 0;
|
||||
int old_signal_val = signal_val;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue