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)
48 #define AtomicZAP(x) __sync_fetch_and_and(&x, 0)
50 #define AtomicBeg(Mtx) Mtx.Lock()
51 #define AtomicEnd(Mtx) Mtx.UnLock()
52 #define AtomicAdd(x, y) x += y
53 #define AtomicCAS(x, y, z) if (x == y) x = z
54 #define AtomicDec(x) x--
55 #define AtomicFAZ(x) x; x = 0
56 #define AtomicGet(x) x
57 #define AtomicInc(x) x++
58 #define AtomicSub(x, y) x -= y
59 #define AtomicZAP(x) x = 0