Use the right memory ordering in SafeNumeric operations
This commit is contained in:
parent
3ae61590e1
commit
02a584d8e6
1 changed files with 2 additions and 2 deletions
|
@ -111,7 +111,7 @@ public:
|
|||
if (tmp >= p_value) {
|
||||
return tmp; // already greater, or equal
|
||||
}
|
||||
if (value.compare_exchange_weak(tmp, p_value, std::memory_order_release)) {
|
||||
if (value.compare_exchange_weak(tmp, p_value, std::memory_order_acq_rel)) {
|
||||
return p_value;
|
||||
}
|
||||
}
|
||||
|
@ -123,7 +123,7 @@ public:
|
|||
if (c == 0) {
|
||||
return 0;
|
||||
}
|
||||
if (value.compare_exchange_weak(c, c + 1, std::memory_order_release)) {
|
||||
if (value.compare_exchange_weak(c, c + 1, std::memory_order_acq_rel)) {
|
||||
return c + 1;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue