[*] AuAsync invalid self itr upon nested poll

This commit is contained in:
Reece Wilson 2022-05-20 00:56:58 +01:00
parent fe88ae9821
commit 342db487f9
2 changed files with 12 additions and 0 deletions

View File

@ -457,6 +457,10 @@ namespace Aurora::Async
bool lowPrioCont {};
bool lowPrioContCached {};
state->cookie++;
int start = state->cookie;
for (auto itr = state->pendingWorkItems.begin(); itr != state->pendingWorkItems.end(); )
{
if (state->threadObject->Exiting() || state->shuttingdown)
@ -511,8 +515,15 @@ namespace Aurora::Async
// Atomically decrement global task counter
runningTasks = this->tasksRunning_.fetch_sub(1) - 1;
if (start != state->cookie)
{
start = state->cookie;
itr = state->pendingWorkItems.begin();
}
}
gCurrentPool = oldTlsHandle;
// Return popped work back to the groups work pool when our -pump loops were preempted

View File

@ -45,5 +45,6 @@ namespace Aurora::Async
AuSPtr<AsyncLoop> asyncLoop;
Utility::RateLimiter rateLimiter;
ERunMode runMode;
int cookie {0};
};
}