mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-27 07:58:49 +01:00
don't track heartbeat independent of any timers set. This allows
infinite timeout when no devices present.
This commit is contained in:
parent
b0d592a174
commit
f2213d05c7
2 changed files with 4 additions and 5 deletions
|
@ -29,7 +29,6 @@
|
|||
|
||||
TimerMgr::TimerMgr()
|
||||
: m_nextFireTime(0)
|
||||
, m_heartbeat(RelayConfigs::GetConfigs()->GetHeartbeatInterval() )
|
||||
{
|
||||
pthread_mutex_init( &m_timersMutex, NULL );
|
||||
}
|
||||
|
@ -74,15 +73,16 @@ TimerMgr::GetPollTimeout()
|
|||
|
||||
time_t tout = m_nextFireTime;
|
||||
if ( tout == 0 ) {
|
||||
tout = m_heartbeat;
|
||||
tout = -1;
|
||||
} else {
|
||||
tout -= now();
|
||||
if ( tout < 0 ) {
|
||||
tout = 0;
|
||||
}
|
||||
tout *= 1000;
|
||||
}
|
||||
return tout * 1000;
|
||||
}
|
||||
return tout;
|
||||
} /* GetPollTimeout */
|
||||
|
||||
int
|
||||
TimerMgr::getTimer( TimerProc proc, void* closure )
|
||||
|
|
|
@ -64,7 +64,6 @@ class TimerMgr {
|
|||
list<TimerInfo> m_timers;
|
||||
|
||||
time_t m_nextFireTime;
|
||||
time_t m_heartbeat;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Reference in a new issue