don't track heartbeat independent of any timers set. This allows

infinite timeout when no devices present.
This commit is contained in:
ehouse 2005-10-19 03:42:17 +00:00
parent b0d592a174
commit f2213d05c7
2 changed files with 4 additions and 5 deletions

View file

@ -29,7 +29,6 @@
TimerMgr::TimerMgr() TimerMgr::TimerMgr()
: m_nextFireTime(0) : m_nextFireTime(0)
, m_heartbeat(RelayConfigs::GetConfigs()->GetHeartbeatInterval() )
{ {
pthread_mutex_init( &m_timersMutex, NULL ); pthread_mutex_init( &m_timersMutex, NULL );
} }
@ -74,15 +73,16 @@ TimerMgr::GetPollTimeout()
time_t tout = m_nextFireTime; time_t tout = m_nextFireTime;
if ( tout == 0 ) { if ( tout == 0 ) {
tout = m_heartbeat; tout = -1;
} else { } else {
tout -= now(); tout -= now();
if ( tout < 0 ) { if ( tout < 0 ) {
tout = 0; tout = 0;
} }
tout *= 1000;
} }
return tout * 1000; return tout;
} } /* GetPollTimeout */
int int
TimerMgr::getTimer( TimerProc proc, void* closure ) TimerMgr::getTimer( TimerProc proc, void* closure )

View file

@ -64,7 +64,6 @@ class TimerMgr {
list<TimerInfo> m_timers; list<TimerInfo> m_timers;
time_t m_nextFireTime; time_t m_nextFireTime;
time_t m_heartbeat;
}; };
#endif #endif