mirror of
https://github.com/zeek/zeek.git
synced 2025-10-12 11:38:20 +00:00
add Terminate to input framework to prevent potential shutdown race-conditions.
This commit is contained in:
parent
a32bb59770
commit
3517c0ba99
3 changed files with 22 additions and 0 deletions
|
@ -1289,6 +1289,7 @@ void Manager::SendEndOfData(ReaderFrontend* reader)
|
|||
SendEndOfData(i);
|
||||
}
|
||||
|
||||
|
||||
void Manager::SendEndOfData(const Stream *i)
|
||||
{
|
||||
#ifdef DEBUG
|
||||
|
@ -2174,3 +2175,18 @@ Manager::Stream* Manager::FindStream(ReaderFrontend* reader)
|
|||
|
||||
return 0;
|
||||
}
|
||||
|
||||
// function is called on Bro shutdown.
|
||||
// sinal all frontends that they will cease operation.
|
||||
void Manager::Terminate()
|
||||
{
|
||||
for (map<ReaderFrontend*, Stream*>::iterator i = readers.begin(); i != readers.end(); ++i )
|
||||
{
|
||||
if ( i->second->removed )
|
||||
continue;
|
||||
|
||||
i->second->removed = true;
|
||||
i->second->reader->Stop();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue