Implement atomic_t<>::release

More relaxed store with release memory order
This commit is contained in:
Nekotekina 2019-01-28 18:39:39 +03:00
parent 50922faac9
commit 2b66abaf10
4 changed files with 60 additions and 26 deletions

View file

@ -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()