diff options
author | Lioncash <mathew1800@gmail.com> | 2019-03-16 04:38:51 +0100 |
---|---|---|
committer | Lioncash <mathew1800@gmail.com> | 2019-03-16 04:58:37 +0100 |
commit | 51d7f6bffcc0498a47abc7de27bf0906fc523dae (patch) | |
tree | 1b0860fc4bfe74197f4a714f549c74f28b4bcc95 /src/core/hle/kernel/svc.cpp | |
parent | kernel/thread: Migrate WaitCurrentThread_Sleep into the Thread interface (diff) | |
download | yuzu-51d7f6bffcc0498a47abc7de27bf0906fc523dae.tar yuzu-51d7f6bffcc0498a47abc7de27bf0906fc523dae.tar.gz yuzu-51d7f6bffcc0498a47abc7de27bf0906fc523dae.tar.bz2 yuzu-51d7f6bffcc0498a47abc7de27bf0906fc523dae.tar.lz yuzu-51d7f6bffcc0498a47abc7de27bf0906fc523dae.tar.xz yuzu-51d7f6bffcc0498a47abc7de27bf0906fc523dae.tar.zst yuzu-51d7f6bffcc0498a47abc7de27bf0906fc523dae.zip |
Diffstat (limited to 'src/core/hle/kernel/svc.cpp')
-rw-r--r-- | src/core/hle/kernel/svc.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/core/hle/kernel/svc.cpp b/src/core/hle/kernel/svc.cpp index bf77ce137..047fa0c19 100644 --- a/src/core/hle/kernel/svc.cpp +++ b/src/core/hle/kernel/svc.cpp @@ -1284,10 +1284,14 @@ static ResultCode StartThread(Handle thread_handle) { /// Called when a thread exits static void ExitThread() { - LOG_TRACE(Kernel_SVC, "called, pc=0x{:08X}", Core::CurrentArmInterface().GetPC()); + auto& system = Core::System::GetInstance(); - ExitCurrentThread(); - Core::System::GetInstance().PrepareReschedule(); + LOG_TRACE(Kernel_SVC, "called, pc=0x{:08X}", system.CurrentArmInterface().GetPC()); + + auto* const current_thread = system.CurrentScheduler().GetCurrentThread(); + current_thread->Stop(); + system.CurrentScheduler().RemoveThread(current_thread); + system.PrepareReschedule(); } /// Sleep the current thread |