diff options
Diffstat (limited to 'linuxthreads/spinlock.h')
-rw-r--r-- | linuxthreads/spinlock.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/linuxthreads/spinlock.h b/linuxthreads/spinlock.h index 703b72d..6d3d343 100644 --- a/linuxthreads/spinlock.h +++ b/linuxthreads/spinlock.h @@ -48,6 +48,10 @@ static inline int compare_and_swap(long * ptr, long oldval, long newval, #elif defined(HAS_COMPARE_AND_SWAP) +#ifdef IMPLEMENT_TAS_WITH_CAS +#define testandset(p) !__compare_and_swap(p, 0, 1) +#endif + #ifdef HAS_COMPARE_AND_SWAP_WITH_RELEASE_SEMANTICS static inline int |