add Terminate to input framework to prevent potential shutdown race-conditions.

This commit is contained in:
Bernhard Amann 2013-06-09 08:27:08 -04:00
parent a32bb59770
commit 3517c0ba99
3 changed files with 22 additions and 0 deletions

View file

@ -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();
}
}