|
|
@ -54,9 +54,10 @@ void CScheduler::serviceQueue() |
|
|
|
#else |
|
|
|
#else |
|
|
|
// Some boost versions have a conflicting overload of wait_until that returns void.
|
|
|
|
// Some boost versions have a conflicting overload of wait_until that returns void.
|
|
|
|
// Explicitly use a template here to avoid hitting that overload.
|
|
|
|
// Explicitly use a template here to avoid hitting that overload.
|
|
|
|
while (!shouldStop() && !taskQueue.empty() && |
|
|
|
while (!shouldStop() && !taskQueue.empty()) { |
|
|
|
newTaskScheduled.wait_until<>(lock, taskQueue.begin()->first) != boost::cv_status::timeout) { |
|
|
|
boost::chrono::system_clock::time_point timeToWaitFor = taskQueue.begin()->first; |
|
|
|
// Keep waiting until timeout
|
|
|
|
if (newTaskScheduled.wait_until<>(lock, timeToWaitFor) == boost::cv_status::timeout) |
|
|
|
|
|
|
|
break; // Exit loop after timeout, it means we reached the time of the event
|
|
|
|
} |
|
|
|
} |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
// If there are multiple threads, the queue can empty while we're waiting (another
|
|
|
|
// If there are multiple threads, the queue can empty while we're waiting (another
|
|
|
|