summaryrefslogtreecommitdiff
path: root/src/core/hle/kernel
diff options
context:
space:
mode:
authorGravatar Fernando Sahmkow2019-10-07 19:09:57 -0400
committerGravatar FernandoS272019-10-15 11:55:19 -0400
commit71768571775ff989a577a773574f5f5bdeb14d33 (patch)
treeca91bc1c7cb08c4ecf4f8079ac3755272d482cfb /src/core/hle/kernel
parentKernel: Correct Results in Condition Variables and Mutexes (diff)
downloadyuzu-71768571775ff989a577a773574f5f5bdeb14d33.tar.gz
yuzu-71768571775ff989a577a773574f5f5bdeb14d33.tar.xz
yuzu-71768571775ff989a577a773574f5f5bdeb14d33.zip
Kernel: Corrections to ModifyByWaitingCountAndSignalToAddressIfEqual
Diffstat (limited to 'src/core/hle/kernel')
-rw-r--r--src/core/hle/kernel/address_arbiter.cpp18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/core/hle/kernel/address_arbiter.cpp b/src/core/hle/kernel/address_arbiter.cpp
index 4c1d3fd18..de0a9064e 100644
--- a/src/core/hle/kernel/address_arbiter.cpp
+++ b/src/core/hle/kernel/address_arbiter.cpp
@@ -91,12 +91,20 @@ ResultCode AddressArbiter::ModifyByWaitingCountAndSignalToAddressIfEqual(VAddr a
91 91
92 // Determine the modified value depending on the waiting count. 92 // Determine the modified value depending on the waiting count.
93 s32 updated_value; 93 s32 updated_value;
94 if (waiting_threads.empty()) { 94 if (num_to_wake <= 0) {
95 updated_value = value + 1; 95 if (waiting_threads.empty()) {
96 } else if (num_to_wake <= 0 || waiting_threads.size() <= static_cast<u32>(num_to_wake)) { 96 updated_value = value + 1;
97 updated_value = value - 1; 97 } else {
98 updated_value = value - 1;
99 }
98 } else { 100 } else {
99 updated_value = value; 101 if (waiting_threads.empty()) {
102 updated_value = value + 1;
103 } else if (waiting_threads.size() <= static_cast<u32>(num_to_wake)) {
104 updated_value = value - 1;
105 } else {
106 updated_value = value;
107 }
100 } 108 }
101 109
102 if (static_cast<s32>(Memory::Read32(address)) != value) { 110 if (static_cast<s32>(Memory::Read32(address)) != value) {