Merge remote-tracking branch 'origin/master' into topic/robin/dataseries

Conflicts:
	CMakeLists.txt
	cmake
This commit is contained in:
Robin Sommer 2012-04-17 16:37:37 -07:00
commit a7bc12066b
104 changed files with 1523 additions and 338 deletions

View file

@ -43,6 +43,7 @@ void Manager::Terminate()
msg_threads.clear();
idle = true;
closed = true;
terminating = false;
}
@ -73,14 +74,11 @@ void Manager::GetFds(int* read, int* write, int* except)
double Manager::NextTimestamp(double* network_time)
{
if ( ::network_time && ! next_beat )
next_beat = ::network_time + HEART_BEAT_INTERVAL;
// fprintf(stderr, "N %.6f %.6f did_process=%d next_next=%.6f\n", ::network_time, timer_mgr->Time(), (int)did_process, next_beat);
if ( did_process || ::network_time > next_beat )
if ( ::network_time && (did_process || ::network_time > next_beat || ! next_beat) )
// If we had something to process last time (or out heartbeat
// is due), we want to check for more asap.
// is due or not set yet), we want to check for more asap.
return timer_mgr->Time();
return -1.0;
@ -88,7 +86,13 @@ double Manager::NextTimestamp(double* network_time)
void Manager::Process()
{
bool do_beat = (next_beat && network_time > next_beat);
bool do_beat = false;
if ( network_time && (network_time > next_beat || ! next_beat) )
{
do_beat = true;
next_beat = ::network_time + HEART_BEAT_INTERVAL;
}
did_process = false;
@ -97,10 +101,7 @@ void Manager::Process()
MsgThread* t = *i;
if ( do_beat )
{
t->Heartbeat();
next_beat = 0;
}
while ( t->HasOut() )
{