[+] Added some notes about safer low memory condition handling
[*] Adjusted code style in MSDN reference code
This commit is contained in:
parent
cb6ebc3b10
commit
77775410ec
@ -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
|
||||
|
@ -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();
|
||||
|
@ -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)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user