summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/sys/stdatomic.h6
1 files changed, 1 insertions, 5 deletions
diff --git a/sys/sys/stdatomic.h b/sys/sys/stdatomic.h
index 054ded6..37c3a06 100644
--- a/sys/sys/stdatomic.h
+++ b/sys/sys/stdatomic.h
@@ -381,11 +381,7 @@ static __inline _Bool
atomic_flag_test_and_set_explicit(volatile atomic_flag *__object,
memory_order __order)
{
- _Bool __expected;
-
- __expected = 0;
- return (atomic_compare_exchange_strong_explicit(&__object->__flag,
- &__expected, 1, __order, __order));
+ return (atomic_exchange_explicit(&__object->__flag, 1, __order));
}
static __inline void
OpenPOWER on IntegriCloud