mirror of
https://gitlab.freedesktop.org/mesa/drm.git
synced 2025-12-20 14:00:11 +01:00
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>
This commit is contained in:
parent
cd4685498b
commit
7caa442e76
1 changed files with 1 additions and 1 deletions
|
|
@ -50,7 +50,7 @@ typedef struct {
|
||||||
# define atomic_set(x, val) ((x)->atomic = (val))
|
# define atomic_set(x, val) ((x)->atomic = (val))
|
||||||
# define atomic_inc(x) ((void) __sync_fetch_and_add (&(x)->atomic, 1))
|
# define atomic_inc(x) ((void) __sync_fetch_and_add (&(x)->atomic, 1))
|
||||||
# define atomic_inc_return(x) (__sync_add_and_fetch (&(x)->atomic, 1))
|
# define atomic_inc_return(x) (__sync_add_and_fetch (&(x)->atomic, 1))
|
||||||
# define atomic_dec_and_test(x) (__sync_fetch_and_add (&(x)->atomic, -1) == 1)
|
# define atomic_dec_and_test(x) (__sync_add_and_fetch (&(x)->atomic, -1) == 0)
|
||||||
# define atomic_add(x, v) ((void) __sync_add_and_fetch(&(x)->atomic, (v)))
|
# define atomic_add(x, v) ((void) __sync_add_and_fetch(&(x)->atomic, (v)))
|
||||||
# define atomic_dec(x, v) ((void) __sync_sub_and_fetch(&(x)->atomic, (v)))
|
# define atomic_dec(x, v) ((void) __sync_sub_and_fetch(&(x)->atomic, (v)))
|
||||||
# define atomic_cmpxchg(x, oldv, newv) __sync_val_compare_and_swap (&(x)->atomic, oldv, newv)
|
# define atomic_cmpxchg(x, oldv, newv) __sync_val_compare_and_swap (&(x)->atomic, oldv, newv)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue