+static inline bool
+atomic_flag_test_and_set(volatile atomic_flag *flag_)
+{
+ atomic_flag *flag = CONST_CAST(atomic_flag *, flag_);
+ bool old_value;
+
+ atomic_lock__(flag);
+ old_value = flag->b;
+ flag->b = true;
+ atomic_unlock__(flag);
+
+ return old_value;
+}
+
+static inline bool
+atomic_flag_test_and_set_explicit(volatile atomic_flag *flag,
+ memory_order order OVS_UNUSED)
+{
+ return atomic_flag_test_and_set(flag);
+}