Go to the documentation of this file. 1 #ifndef _XRDSYSATOMICS_
2 #define _XRDSYSATOMICS_
39 #define AtomicBeg(Mtx)
40 #define AtomicEnd(Mtx)
41 #define AtomicAdd(x, y) __sync_fetch_and_add(&x, y)
42 #define AtomicCAS(x, y, z) __sync_bool_compare_and_swap(&x, y, z)
43 #define AtomicDec(x) __sync_fetch_and_sub(&x, 1)
44 #define AtomicFAZ(x) __sync_fetch_and_and(&x, 0)
45 #define AtomicGet(x) __sync_fetch_and_or(&x, 0)
46 #define AtomicInc(x) __sync_fetch_and_add(&x, 1)
47 #define AtomicSub(x, y) __sync_fetch_and_sub(&x, y)
49 #define AtomicBeg(Mtx) Mtx.Lock()
50 #define AtomicEnd(Mtx) Mtx.UnLock()
51 #define AtomicAdd(x, y) x += y
52 #define AtomicCAS(x, y, z) if (x == y) x = z
53 #define AtomicDec(x) x--
54 #define AtomicFAZ(x) x; x = 0
55 #define AtomicGet(x) x
56 #define AtomicInc(x) x++
57 #define AtomicSub(x, y) x -= y