Auto merge of #4600 - daira:fix-cscheduler, r=daira
Fix bug in CScheduler
This commit is contained in:
commit
6caed410c0
|
@ -40,9 +40,12 @@ void CScheduler::serviceQueue()
|
|||
|
||||
// Some boost versions have a conflicting overload of wait_until that returns void.
|
||||
// Explicitly use a template here to avoid hitting that overload.
|
||||
while (!shouldStop() && !taskQueue.empty() &&
|
||||
newTaskScheduled.wait_until<>(lock, taskQueue.begin()->first) != boost::cv_status::timeout) {
|
||||
// Keep waiting until timeout
|
||||
while (!shouldStop() && !taskQueue.empty())
|
||||
{
|
||||
auto copy = taskQueue.begin()->first;
|
||||
if (newTaskScheduled.wait_until<>(lock, copy) == boost::cv_status::timeout) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// If there are multiple threads, the queue can empty while we're waiting (another
|
||||
|
|
Loading…
Reference in New Issue