Core/TaskScheduler: Use WorkStealingQueue::pop
steal() can incorrectly return nullptr even if the list is not empty in case of concurrent access, but push and pop are not threadsafe so we use a spinlock to prevent concurrent uses
This commit is contained in:
@@ -35,7 +35,8 @@ SCENARIO("TaskScheduler", "[CORE][TaskScheduler]")
|
||||
}
|
||||
scheduler.WaitForTasks();
|
||||
|
||||
CHECK(count == taskCount);
|
||||
unsigned int c = count.load(); //< load it once before checking to avoid race condition when testing and printing
|
||||
CHECK(c == taskCount);
|
||||
|
||||
for (std::size_t i = 0; i < taskCount; ++i)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user