summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2018-07-17 16:32:42 +0200
committerGitHub <noreply@github.com>2018-07-17 16:32:42 +0200
commit519035db3d5fda9517a4efe5c25f1a1d20d0a7c2 (patch)
tree60667cdb8ebc3bd2ac189207a23c77d2ca71118c /src
parentMerge pull request #673 from bunnei/fix-buffer-queue-evt (diff)
parentKernel/Arbiter: Fix bug in WaitIfLessThan (diff)
downloadyuzu-519035db3d5fda9517a4efe5c25f1a1d20d0a7c2.tar
yuzu-519035db3d5fda9517a4efe5c25f1a1d20d0a7c2.tar.gz
yuzu-519035db3d5fda9517a4efe5c25f1a1d20d0a7c2.tar.bz2
yuzu-519035db3d5fda9517a4efe5c25f1a1d20d0a7c2.tar.lz
yuzu-519035db3d5fda9517a4efe5c25f1a1d20d0a7c2.tar.xz
yuzu-519035db3d5fda9517a4efe5c25f1a1d20d0a7c2.tar.zst
yuzu-519035db3d5fda9517a4efe5c25f1a1d20d0a7c2.zip
Diffstat (limited to 'src')
-rw-r--r--src/core/hle/kernel/address_arbiter.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/core/hle/kernel/address_arbiter.cpp b/src/core/hle/kernel/address_arbiter.cpp
index e9c8369d7..d5df9590a 100644
--- a/src/core/hle/kernel/address_arbiter.cpp
+++ b/src/core/hle/kernel/address_arbiter.cpp
@@ -115,7 +115,7 @@ ResultCode ModifyByWaitingCountAndSignalToAddressIfEqual(VAddr address, s32 valu
s32 updated_value;
if (waiting_threads.size() == 0) {
updated_value = value - 1;
- } else if (num_to_wake <= 0 || waiting_threads.size() <= num_to_wake) {
+ } else if (num_to_wake <= 0 || waiting_threads.size() <= static_cast<u32>(num_to_wake)) {
updated_value = value + 1;
} else {
updated_value = value;
@@ -140,7 +140,9 @@ ResultCode WaitForAddressIfLessThan(VAddr address, s32 value, s64 timeout, bool
s32 cur_value = static_cast<s32>(Memory::Read32(address));
if (cur_value < value) {
- Memory::Write32(address, static_cast<u32>(cur_value - 1));
+ if (should_decrement) {
+ Memory::Write32(address, static_cast<u32>(cur_value - 1));
+ }
} else {
return ERR_INVALID_STATE;
}