aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaarten Lankhorst2015-02-26 04:54:02 -0600
committerMaarten Lankhorst2015-03-13 14:21:57 -0500
commit7caa442e761ab5e48698c937aea9ce18f4522ecb (patch)
tree83b7a81c99bb50dcbfbd0e1aadcaf548a5f7f8a1 /xf86atomic.h
parentcd4685498b7926cf3fb39c6d0d25b2bc76c29f68 (diff)
downloadexternal-libdrm-7caa442e761ab5e48698c937aea9ce18f4522ecb.tar.gz
external-libdrm-7caa442e761ab5e48698c937aea9ce18f4522ecb.tar.xz
external-libdrm-7caa442e761ab5e48698c937aea9ce18f4522ecb.zip
Use __sync_add_and_fetch instead of __sync_fetch_and_add for atomic_dec_and_test
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@ubuntu.com> Acked-By: Emil Velikov <emil.l.velikov@gmail.com>
Diffstat (limited to 'xf86atomic.h')
-rw-r--r--xf86atomic.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/xf86atomic.h b/xf86atomic.h
index 17fb088d..194554ce 100644
--- a/xf86atomic.h
+++ b/xf86atomic.h
@@ -50,7 +50,7 @@ typedef struct {
50# define atomic_set(x, val) ((x)->atomic = (val)) 50# define atomic_set(x, val) ((x)->atomic = (val))
51# define atomic_inc(x) ((void) __sync_fetch_and_add (&(x)->atomic, 1)) 51# define atomic_inc(x) ((void) __sync_fetch_and_add (&(x)->atomic, 1))
52# define atomic_inc_return(x) (__sync_add_and_fetch (&(x)->atomic, 1)) 52# define atomic_inc_return(x) (__sync_add_and_fetch (&(x)->atomic, 1))
53# define atomic_dec_and_test(x) (__sync_fetch_and_add (&(x)->atomic, -1) == 1) 53# define atomic_dec_and_test(x) (__sync_add_and_fetch (&(x)->atomic, -1) == 0)
54# define atomic_add(x, v) ((void) __sync_add_and_fetch(&(x)->atomic, (v))) 54# define atomic_add(x, v) ((void) __sync_add_and_fetch(&(x)->atomic, (v)))
55# define atomic_dec(x, v) ((void) __sync_sub_and_fetch(&(x)->atomic, (v))) 55# define atomic_dec(x, v) ((void) __sync_sub_and_fetch(&(x)->atomic, (v)))
56# define atomic_cmpxchg(x, oldv, newv) __sync_val_compare_and_swap (&(x)->atomic, oldv, newv) 56# define atomic_cmpxchg(x, oldv, newv) __sync_val_compare_and_swap (&(x)->atomic, oldv, newv)