[*] caught async crash on shutdown

This commit is contained in:
Reece Wilson 2023-10-02 21:33:15 +01:00
parent a60e740328
commit 9686457891

View File

@ -43,11 +43,21 @@ namespace Aurora::Async
{
AU_LOCK_GUARD(this->workersMutex);
for (const auto &worker : this->workers)
for (const auto &[id, pWorker] : this->workers)
{
AuAtomicAdd(&worker.second->cvHasWork, 1u);
worker.second->cvVariable->Broadcast();
worker.second->eventLs->Set();
if (!pWorker)
{
continue;
}
AuAtomicAdd(&pWorker->cvHasWork, 1u);
pWorker->cvVariable->Broadcast();
if (auto pEventLS = pWorker->eventLs)
{
pEventLS->Set();
}
}
}