[+] Added some notes about safer low memory condition handling

[*] Adjusted code style in MSDN reference code
This commit is contained in:
Reece Wilson 2021-12-26 15:51:31 +00:00
parent cb6ebc3b10
commit 77775410ec
3 changed files with 15 additions and 5 deletions

View File

@ -35,7 +35,11 @@ namespace Aurora::Async
{
if (itr->ns <= time)
{
pending.push_back(std::move(*itr));
if (!AuTryInsert(pending, std::move(*itr)))
{
break;
}
itr = gEntries.erase(itr);
}
else

View File

@ -299,6 +299,7 @@ namespace Aurora::Async
(state->pendingWorkItems.size() < state->multipopCount));
)
{
// TODO: catch low memory condition
if (itr->first == Async::kThreadIdAny)
{
state->pendingWorkItems.push_back(*itr);
@ -404,6 +405,7 @@ namespace Aurora::Async
if (state->pendingWorkItems.size())
{
AU_LOCK_GUARD(group->cvWorkMutex);
// TODO: low memory condition slow path
group->workQueue.insert(group->workQueue.end(), state->pendingWorkItems.begin(), state->pendingWorkItems.end());
group->eventLs->Set();
state->pendingWorkItems.clear();

View File

@ -346,17 +346,21 @@ namespace Aurora::IO::FS
}
Cleanup:
if (pSIDEveryone)
{
FreeSid(pSIDEveryone);
}
if (pACL)
LocalFree(pACL);
{
LocalFree(pACL);
}
if (hToken)
CloseHandle(hToken);
{
CloseHandle(hToken);
}
if (!bRetval)
{