File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -54,9 +54,10 @@ void CScheduler::serviceQueue()
54
54
#else
55
55
// Some boost versions have a conflicting overload of wait_until that returns void.
56
56
// Explicitly use a template here to avoid hitting that overload.
57
- while (!shouldStop () && !taskQueue.empty () &&
58
- newTaskScheduled.wait_until <>(lock, taskQueue.begin ()->first ) != boost::cv_status::timeout) {
59
- // Keep waiting until timeout
57
+ while (!shouldStop () && !taskQueue.empty ()) {
58
+ boost::chrono::system_clock::time_point timeToWaitFor = taskQueue.begin ()->first ;
59
+ if (newTaskScheduled.wait_until <>(lock, timeToWaitFor) == boost::cv_status::timeout)
60
+ break ; // Exit loop after timeout, it means we reached the time of the event
60
61
}
61
62
#endif
62
63
// If there are multiple threads, the queue can empty while we're waiting (another
You can’t perform that action at this time.
0 commit comments