diff options
Diffstat (limited to 'src/core/hle/kernel/svc/svc_activity.cpp')
-rw-r--r-- | src/core/hle/kernel/svc/svc_activity.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/core/hle/kernel/svc/svc_activity.cpp b/src/core/hle/kernel/svc/svc_activity.cpp index 1dcdb7a15..63bc08555 100644 --- a/src/core/hle/kernel/svc/svc_activity.cpp +++ b/src/core/hle/kernel/svc/svc_activity.cpp @@ -16,18 +16,19 @@ Result SetThreadActivity(Core::System& system, Handle thread_handle, thread_activity); // Validate the activity. - constexpr auto IsValidThreadActivity = [](ThreadActivity activity) { + static constexpr auto IsValidThreadActivity = [](ThreadActivity activity) { return activity == ThreadActivity::Runnable || activity == ThreadActivity::Paused; }; R_UNLESS(IsValidThreadActivity(thread_activity), ResultInvalidEnumValue); // Get the thread from its handle. KScopedAutoObject thread = - system.Kernel().CurrentProcess()->GetHandleTable().GetObject<KThread>(thread_handle); + GetCurrentProcess(system.Kernel()).GetHandleTable().GetObject<KThread>(thread_handle); R_UNLESS(thread.IsNotNull(), ResultInvalidHandle); // Check that the activity is being set on a non-current thread for the current process. - R_UNLESS(thread->GetOwnerProcess() == system.Kernel().CurrentProcess(), ResultInvalidHandle); + R_UNLESS(thread->GetOwnerProcess() == GetCurrentProcessPointer(system.Kernel()), + ResultInvalidHandle); R_UNLESS(thread.GetPointerUnsafe() != GetCurrentThreadPointer(system.Kernel()), ResultBusy); // Set the activity. |