aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.HLE/HOS/Kernel/SupervisorCall/SvcHandler.cs
diff options
context:
space:
mode:
authorThog <me@thog.eu>2019-12-26 02:50:17 +0100
committerAc_K <Acoustik666@gmail.com>2019-12-26 02:50:17 +0100
commit55c956e2ec83b2b7f414688c4fe4ed9f1f316935 (patch)
treea543fffefd7b014d6f4a7c5688040e68edcbe018 /Ryujinx.HLE/HOS/Kernel/SupervisorCall/SvcHandler.cs
parent87bfe681ef65ed692aa1e46e3f5f8229013cf46a (diff)
Make HLE disposable safely (#850)
* Make HLE disposable safely This fix the oldest issue with the HLE code: the kernel side disposability. Changelog: - Implement KProcess::UnpauseAndTerminateAllThreadsExcept, KThread::Terminate, KThread::TerminateCurrentProcess, KThread::PrepareForTermiation and the svc post handler accurately. - Implement svcTerminateProcess and svcExitProcess. (both untested) - Fix KHandleTable::Destroy not decrementing refcount of all objects stored in the table. - Spawn a custom KProcess with the maximum priority to terminate every guest KProcess. (terminating kernel emulation safely) - General system stability improvements to enhance the user's experience. * Fix a typo in a comment in KProcess.cs * Address gdk's comments
Diffstat (limited to 'Ryujinx.HLE/HOS/Kernel/SupervisorCall/SvcHandler.cs')
-rw-r--r--Ryujinx.HLE/HOS/Kernel/SupervisorCall/SvcHandler.cs10
1 files changed, 10 insertions, 0 deletions
diff --git a/Ryujinx.HLE/HOS/Kernel/SupervisorCall/SvcHandler.cs b/Ryujinx.HLE/HOS/Kernel/SupervisorCall/SvcHandler.cs
index e3a4b375..0bf5e5fa 100644
--- a/Ryujinx.HLE/HOS/Kernel/SupervisorCall/SvcHandler.cs
+++ b/Ryujinx.HLE/HOS/Kernel/SupervisorCall/SvcHandler.cs
@@ -1,5 +1,6 @@
using ARMeilleure.State;
using Ryujinx.HLE.HOS.Kernel.Process;
+using Ryujinx.HLE.HOS.Kernel.Threading;
using System;
namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
@@ -29,6 +30,15 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall
ExecutionContext context = (ExecutionContext)sender;
svcFunc(this, context);
+
+ PostSvcHandler();
+ }
+
+ private void PostSvcHandler()
+ {
+ KThread currentThread = _system.Scheduler.GetCurrentThread();
+
+ currentThread.HandlePostSyscall();
}
}
} \ No newline at end of file