mirror of
https://github.com/cemu-project/Cemu.git
synced 2024-11-22 09:09:18 +01:00
Fix incorrect return values in OSAtomic
This commit is contained in:
parent
808d1bb424
commit
633e5c0e05
@ -33,10 +33,11 @@ namespace coreinit
|
||||
|
||||
uint32 OSAddAtomic(std::atomic<uint32be>* mem, uint32 adder)
|
||||
{
|
||||
// used by SDL Wii U port
|
||||
uint32be knownValue;
|
||||
while (true)
|
||||
{
|
||||
uint32be knownValue = mem->load();
|
||||
knownValue = mem->load();
|
||||
uint32be newValue = knownValue + adder;
|
||||
if (mem->compare_exchange_strong(knownValue, newValue))
|
||||
break;
|
||||
@ -68,7 +69,7 @@ namespace coreinit
|
||||
uint64be knownValue;
|
||||
while (true)
|
||||
{
|
||||
uint64be knownValue = mem->load();
|
||||
knownValue = mem->load();
|
||||
uint64be newValue = knownValue + adder;
|
||||
if (mem->compare_exchange_strong(knownValue, newValue))
|
||||
break;
|
||||
@ -81,7 +82,7 @@ namespace coreinit
|
||||
uint64be knownValue;
|
||||
while (true)
|
||||
{
|
||||
uint64be knownValue = mem->load();
|
||||
knownValue = mem->load();
|
||||
uint64be newValue = knownValue & val;
|
||||
if (mem->compare_exchange_strong(knownValue, newValue))
|
||||
break;
|
||||
@ -94,7 +95,7 @@ namespace coreinit
|
||||
uint64be knownValue;
|
||||
while (true)
|
||||
{
|
||||
uint64be knownValue = mem->load();
|
||||
knownValue = mem->load();
|
||||
uint64be newValue = knownValue | val;
|
||||
if (mem->compare_exchange_strong(knownValue, newValue))
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user