[*] Fix a deadlock in auasync

This commit is contained in:
Reece Wilson 2022-05-19 04:07:10 +01:00
parent 997c7cb325
commit 4079d471a7

View File

@ -501,11 +501,14 @@ namespace Aurora::Async
} }
// Dispatch // Dispatch
itr->second->RunAsync(); auto oops = itr->second;
// Remove from our local job queue // Remove from our local job queue
itr = state->pendingWorkItems.erase(itr); itr = state->pendingWorkItems.erase(itr);
// Dispatch
oops->RunAsync();
// Atomically decrement global task counter // Atomically decrement global task counter
runningTasks = this->tasksRunning_.fetch_sub(1) - 1; runningTasks = this->tasksRunning_.fetch_sub(1) - 1;
} }