[*] Harden AuAsync shutdown

This commit is contained in:
Reece Wilson 2024-02-01 21:35:42 +00:00
parent b7a5bfe8b3
commit 0784d9101c

View File

@ -356,7 +356,8 @@ namespace Aurora::Async
}
while (state->pendingWorkItems.empty() && block);
if (!block) // quick hack: is worthy of io reset by virtue of having polled externally (most likely for IO ticks, unlikely for intraprocess ticks)
if (!block &&
!(this->shuttingdown_ & 2)) // quick hack: is worthy of io reset by virtue of having polled externally (most likely for IO ticks, unlikely for intraprocess ticks)
{
AU_LOCK_GUARD(group->workQueue.mutex); // dont atomically increment our work counters [signal under mutex group]...
AU_LOCK_GUARD(group->workersMutex); // dont atomically increment our work counters [broadcast]...