summaryrefslogtreecommitdiff
path: root/src/core/hle/kernel/svc.cpp
diff options
context:
space:
mode:
authorGravatar Lioncash2019-04-17 07:08:12 -0400
committerGravatar Lioncash2019-04-17 09:30:56 -0400
commit433b59c1121a257ae3c1503fff5b71d3f3852ab5 (patch)
tree23f4cbe699ff28d3f5907aff55f49081623d419b /src/core/hle/kernel/svc.cpp
parentMerge pull request #2315 from ReinUsesLisp/severity-decompiler (diff)
downloadyuzu-433b59c1121a257ae3c1503fff5b71d3f3852ab5.tar.gz
yuzu-433b59c1121a257ae3c1503fff5b71d3f3852ab5.tar.xz
yuzu-433b59c1121a257ae3c1503fff5b71d3f3852ab5.zip
kernel/svc: Migrate svcCancelSynchronization behavior to a thread function
The actual behavior of this function is slightly more complex than what we're currently doing within the supervisor call. To avoid dumping most of this behavior in the supervisor call itself, we can migrate this to another function.
Diffstat (limited to 'src/core/hle/kernel/svc.cpp')
-rw-r--r--src/core/hle/kernel/svc.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/core/hle/kernel/svc.cpp b/src/core/hle/kernel/svc.cpp
index d48a2203a..b25190882 100644
--- a/src/core/hle/kernel/svc.cpp
+++ b/src/core/hle/kernel/svc.cpp
@@ -518,16 +518,14 @@ static ResultCode CancelSynchronization(Core::System& system, Handle thread_hand
518 LOG_TRACE(Kernel_SVC, "called thread=0x{:X}", thread_handle); 518 LOG_TRACE(Kernel_SVC, "called thread=0x{:X}", thread_handle);
519 519
520 const auto& handle_table = system.Kernel().CurrentProcess()->GetHandleTable(); 520 const auto& handle_table = system.Kernel().CurrentProcess()->GetHandleTable();
521 const SharedPtr<Thread> thread = handle_table.Get<Thread>(thread_handle); 521 SharedPtr<Thread> thread = handle_table.Get<Thread>(thread_handle);
522 if (!thread) { 522 if (!thread) {
523 LOG_ERROR(Kernel_SVC, "Thread handle does not exist, thread_handle=0x{:08X}", 523 LOG_ERROR(Kernel_SVC, "Thread handle does not exist, thread_handle=0x{:08X}",
524 thread_handle); 524 thread_handle);
525 return ERR_INVALID_HANDLE; 525 return ERR_INVALID_HANDLE;
526 } 526 }
527 527
528 ASSERT(thread->GetStatus() == ThreadStatus::WaitSynchAny); 528 thread->CancelWait();
529 thread->SetWaitSynchronizationResult(ERR_SYNCHRONIZATION_CANCELED);
530 thread->ResumeFromWait();
531 return RESULT_SUCCESS; 529 return RESULT_SUCCESS;
532} 530}
533 531