mirror of
https://git.suyu.dev/suyu/suyu
synced 2024-11-02 05:17:52 +00:00
Merge pull request #672 from SciresM/to_address_fix
svc:: Fix bug in svcWaitForAddress
This commit is contained in:
commit
519035db3d
1 changed files with 4 additions and 2 deletions
|
@ -115,7 +115,7 @@ ResultCode ModifyByWaitingCountAndSignalToAddressIfEqual(VAddr address, s32 valu
|
||||||
s32 updated_value;
|
s32 updated_value;
|
||||||
if (waiting_threads.size() == 0) {
|
if (waiting_threads.size() == 0) {
|
||||||
updated_value = value - 1;
|
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;
|
updated_value = value + 1;
|
||||||
} else {
|
} else {
|
||||||
updated_value = value;
|
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));
|
s32 cur_value = static_cast<s32>(Memory::Read32(address));
|
||||||
if (cur_value < value) {
|
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 {
|
} else {
|
||||||
return ERR_INVALID_STATE;
|
return ERR_INVALID_STATE;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue