aboutsummaryrefslogtreecommitdiff
path: root/src/core/hle/kernel/svc.cpp
diff options
context:
space:
mode:
authorFernando Sahmkow <fsahmkow27@gmail.com>2019-11-16 11:05:39 -0400
committerFernandoS27 <fsahmkow27@gmail.com>2019-11-16 12:41:51 -0400
commit323a0e17e7b656ce5f7ea7e2710d4d4fae27bb74 (patch)
treea76350979c9df80abaeb271173b09f0fcf488070 /src/core/hle/kernel/svc.cpp
parentf24bc2e049378c9f0660d3eec9b6ae91a6c5552c (diff)
Kernel: Correct Cancel Synchronization.
This commit corrects the behavior of cancel synchronization when the thread is running/ready and ensures the next wait is cancelled as it's suppose to.
Diffstat (limited to 'src/core/hle/kernel/svc.cpp')
-rw-r--r--src/core/hle/kernel/svc.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/core/hle/kernel/svc.cpp b/src/core/hle/kernel/svc.cpp
index c63a9ba8bb..b2cef3be99 100644
--- a/src/core/hle/kernel/svc.cpp
+++ b/src/core/hle/kernel/svc.cpp
@@ -505,6 +505,11 @@ static ResultCode WaitSynchronization(Core::System& system, Handle* index, VAddr
return RESULT_TIMEOUT;
}
+ if (thread->IsSyncCancelled()) {
+ thread->SetSyncCancelled(false);
+ return ERR_SYNCHRONIZATION_CANCELED;
+ }
+
for (auto& object : objects) {
object->AddWaitingThread(thread);
}