[*] caught async crash on shutdown
This commit is contained in:
parent
a60e740328
commit
9686457891
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user