kern: KAutoObject destruction is now scheduled for next dpc-time

This commit is contained in:
Michael Scire 2021-04-07 13:38:51 -07:00 committed by SciresM
parent 15956fcf9a
commit 4407237f5b
7 changed files with 94 additions and 18 deletions

View file

@ -74,12 +74,17 @@ namespace ams::kern::svc {
/* Wait for a message. */
while (true) {
/* Close any pending objects before we wait. */
GetCurrentThread().DestroyClosedObjects();
/* Wait for an object. */
s32 index;
Result result = KSynchronizationObject::Wait(std::addressof(index), objs, num_objects, timeout);
if (svc::ResultTimedOut::Includes(result)) {
return result;
}
/* Receive the request. */
if (R_SUCCEEDED(result)) {
KServerSession *session = objs[index]->DynamicCast<KServerSession *>();
if (session != nullptr) {