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:
SirLynix
2024-02-02 23:19:29 +01:00
parent 2e56bb4db4
commit c303bf9283
2 changed files with 65 additions and 6 deletions

View File

@@ -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)
{