BIT-1408: improve I/O loop and Broker IOSource.

This commit is contained in:
Jon Siwek 2015-06-03 08:25:49 -05:00
parent a6618eb964
commit 58ea1ff458
4 changed files with 24 additions and 17 deletions

View file

@ -240,6 +240,13 @@ void PktSrc::GetFds(iosource::FD_Set* read, iosource::FD_Set* write,
if ( IsOpen() && props.selectable_fd >= 0 )
read->Insert(props.selectable_fd);
// TODO: This seems like a hack that should be removed, but doing so
// causes the main run loop to spin more frequently and increase cpu usage.
// See also commit 9cd85be308.
if ( read->Empty() ) read->Insert(0);
if ( write->Empty() ) write->Insert(0);
if ( except->Empty() ) except->Insert(0);
}
double PktSrc::NextTimestamp(double* local_network_time)