mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-15 11:18:36 +12:00
Implement atomic_t<>::release
More relaxed store with release memory order
This commit is contained in:
parent
50922faac9
commit
2b66abaf10
4 changed files with 60 additions and 26 deletions
|
@ -245,12 +245,7 @@ public:
|
|||
|
||||
void set_value(u32 value, bool count = true)
|
||||
{
|
||||
const u64 new_data = u64{count} << off_count | value;
|
||||
#ifdef _MSC_VER
|
||||
const_cast<volatile u64&>(data.raw()) = new_data;
|
||||
#else
|
||||
__atomic_store_n(&data.raw(), new_data, __ATOMIC_RELAXED);
|
||||
#endif
|
||||
data.release(u64{count} << off_count | value);
|
||||
}
|
||||
|
||||
u32 get_value()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue