mirror of
https://github.com/zeek/zeek.git
synced 2025-10-07 00:58:19 +00:00
Fix thread processing/termination conditions.
A thread that is done/killed should signify that the thread manager has some processing to do -- it needs to process any messages in its out queue, join the thread, and delete it. Otherwise the thread manager may reach a state where it makes no progress in processing the last remaining done/killed thread.
This commit is contained in:
parent
26be082951
commit
22d35d2c8c
1 changed files with 6 additions and 5 deletions
|
@ -82,7 +82,10 @@ double Manager::NextTimestamp(double* network_time)
|
||||||
{
|
{
|
||||||
MsgThread* t = *i;
|
MsgThread* t = *i;
|
||||||
|
|
||||||
if ( (*i)->MightHaveOut() && ! t->Killed() )
|
if ( t->MightHaveOut() || t->Killed() )
|
||||||
|
// Even if the thread doesn't have output, it may be killed/done,
|
||||||
|
// which should also signify that processing is needed. The
|
||||||
|
// "processing" in that case is joining the thread and deleting it.
|
||||||
return timer_mgr->Time();
|
return timer_mgr->Time();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -149,9 +152,7 @@ void Manager::Process()
|
||||||
{
|
{
|
||||||
BasicThread* t = *i;
|
BasicThread* t = *i;
|
||||||
|
|
||||||
if ( ! t->Killed() )
|
if ( t->Killed() )
|
||||||
continue;
|
|
||||||
|
|
||||||
to_delete.push_back(t);
|
to_delete.push_back(t);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue