diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2009-11-08 02:10:49 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2009-11-08 02:10:49 +0100 |
commit | e99dc95b4cb3ea7ea1cf5fb1606319667bff83cf (patch) | |
tree | acabd686d473db40091888a2a00534d132cff320 /lf_cas.h | |
parent | 0f44dc69adb225a3c5410234491fc8950ed935f7 (diff) | |
download | lock_free-e99dc95b4cb3ea7ea1cf5fb1606319667bff83cf.zip lock_free-e99dc95b4cb3ea7ea1cf5fb1606319667bff83cf.tar.gz |
union ptr_u and lf_eql added to lf_cas
Diffstat (limited to 'lf_cas.h')
-rw-r--r-- | lf_cas.h | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -39,6 +39,12 @@ typedef struct lf_pointer { volatile unsigned int count; } lf_pointer_t; +union ptr_u { + lf_pointer_t ptr; + volatile long long concat; +}; + +#define lf_eql(ptra,ptrb) (((union ptr_u)(ptra)).concat == ((union ptr_u)(ptrb)).concat) /* CMPXCHG8B m64 Compare EDX:EAX with m64. If equal, set ZF and load ECX:EBX into m64. Else, clear ZF and load m64 into EDX:EAX. */ static inline unsigned int cas( volatile lf_pointer_t *mem, |