]> granicus.if.org Git - libatomic_ops/commitdiff
Implement AO_CLEAR using C11 atomic intrinsic (GCC)
authorIvan Maidanski <ivmai@mail.ru>
Thu, 26 Jan 2017 07:38:21 +0000 (10:38 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Thu, 26 Jan 2017 07:39:28 +0000 (10:39 +0300)
* src/atomic_ops/sysdeps/gcc/generic.h [!AO_PREFER_GENERALIZED]
(AO_CLEAR): Implement using GCC built-in __atomic_clear (thus
overriding the default one based on AO_char_store_release).

src/atomic_ops/sysdeps/gcc/generic.h

index 3f736ef82f2bae7b1faf94e51f5b9bb839117f92..59b2edf0d1c44eb1fa7dff41e882be64c2ecc61a 100644 (file)
@@ -89,6 +89,8 @@
 #ifndef AO_PREFER_GENERALIZED
 # include "generic-arithm.h"
 
+# define AO_CLEAR(addr) __atomic_clear(addr, __ATOMIC_RELEASE)
+
   AO_INLINE AO_TS_VAL_t
   AO_test_and_set(volatile AO_TS_t *addr)
   {