mirror of
https://github.com/isc-projects/bind9.git
synced 2026-06-13 18:00:00 -04:00
Stop requiring same memory ordering in win32 atomic_compare_exchange functions
This commit is contained in:
parent
28af0de764
commit
0f9f1ece14
1 changed files with 12 additions and 3 deletions
|
|
@ -222,7 +222,10 @@ atomic_compare_exchange_strong_explicit8(atomic_int_fast8_t *obj,
|
|||
{
|
||||
bool __r;
|
||||
int8_t __v;
|
||||
REQUIRE(succ == fail);
|
||||
|
||||
UNUSED(succ);
|
||||
UNUSED(fail);
|
||||
|
||||
__v = InterlockedCompareExchange8((atomic_int_fast8_t *)obj, desired, *expected);
|
||||
__r = (*(expected) == __v);
|
||||
if (!__r) {
|
||||
|
|
@ -239,7 +242,10 @@ atomic_compare_exchange_strong_explicit32(atomic_int_fast32_t *obj,
|
|||
memory_order fail) {
|
||||
bool __r;
|
||||
int32_t __v;
|
||||
REQUIRE(succ == fail);
|
||||
|
||||
UNUSED(succ);
|
||||
UNUSED(fail);
|
||||
|
||||
switch (succ) {
|
||||
case memory_order_relaxed:
|
||||
__v = InterlockedCompareExchangeNoFence((atomic_int_fast32_t *)obj, desired, *expected);
|
||||
|
|
@ -269,7 +275,10 @@ atomic_compare_exchange_strong_explicit64(atomic_int_fast64_t *obj,
|
|||
memory_order fail) {
|
||||
bool __r;
|
||||
int64_t __v;
|
||||
REQUIRE(succ == fail);
|
||||
|
||||
UNUSED(succ);
|
||||
UNUSED(fail);
|
||||
|
||||
#ifdef _WIN64
|
||||
switch (succ) {
|
||||
case memory_order_relaxed:
|
||||
|
|
|
|||
Loading…
Reference in a new issue