Another Timer fix, testing for backwards jumps in time
This commit is contained in:
parent
bc47e5f230
commit
55c8fd2df2
|
@ -384,6 +384,16 @@ void TimerManager<T, D, E>::threadFunc()
|
|||
|
||||
while (!new_timer_ && T::now() < sleep_end && !quit_)
|
||||
{
|
||||
// detect backwards jumps in time
|
||||
|
||||
if (T::now() < current)
|
||||
{
|
||||
ROS_DEBUG("Time jumped backwards, breaking out of sleep");
|
||||
break;
|
||||
}
|
||||
|
||||
current = T::now();
|
||||
|
||||
timers_cond_.timed_wait(lock, boost::posix_time::milliseconds(1));
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue