/* when we not processed anything, check timers. */
if (!ret)
{
+ /* we know that this time has passed. */
+ now += poll_timeout;
+
singleLock s(recalcLock);
/* this will never change while we have the recalcLock */
return;
/* process all timers which are ready. first remove them out of the list. */
- while ((!m_timer_list.empty()) && (m_timer_list.begin()->getNextActivation() < now))
+ while ((!m_timer_list.empty()) && (m_timer_list.begin()->getNextActivation() <= now))
m_timer_list.begin()->activate();
}
}
return t1.tv_sec < t2.tv_sec || (t1.tv_sec == t2.tv_sec && t1.tv_usec < t2.tv_usec);
}
+static inline bool operator<=( const timeval &t1, const timeval &t2 )
+{
+ return t1.tv_sec < t2.tv_sec || (t1.tv_sec == t2.tv_sec && t1.tv_usec <= t2.tv_usec);
+}
+
static inline timeval &operator+=( timeval &t1, const timeval &t2 )
{
t1.tv_sec += t2.tv_sec;