Silly logic bug introduced in
dda7de17e74d7e8
Timer thread, when msec = 0, instead of going
to sleep, calls check_time() in an endless loop.
Spotted and reported by snino64 due to abnormally
high CPU usage.
No functional change.
while (!do_exit)
{
mutex.lock();
- while (!msec && !do_exit)
- sleepCondition.wait_for(mutex, msec ? msec : INT_MAX);
+ do sleepCondition.wait_for(mutex, msec ? msec : INT_MAX);
+ while (!msec && !do_exit); // Don't allow wakeups when msec = 0
mutex.unlock();
+
check_time();
}
}