From: Jason Ekstrand Date: Thu, 5 Dec 2019 17:49:18 +0000 (-0600) Subject: util/atomic: Add p_atomic_add_return for the unlocked path X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=752196a4938f92395bacba915f3240b88790145a;p=mesa.git util/atomic: Add p_atomic_add_return for the unlocked path Fixes: 385d13f26d2 "util/atomic: Add a _return variant of p_atomic_add" Reviewed-by: Ilia Mirkin --- diff --git a/src/util/u_atomic.h b/src/util/u_atomic.h index 45e8e2e0188..9cbc6dd1eaa 100644 --- a/src/util/u_atomic.h +++ b/src/util/u_atomic.h @@ -92,7 +92,7 @@ #define p_atomic_add(_v, _i) ((void) p_atomic_add_return((_v), (_i)) #define p_atomic_inc_return(_v) (++(*(_v))) #define p_atomic_dec_return(_v) (--(*(_v))) -#define p_atomic_add(_v, _i) (*(_v) = *(_v) + (_i)) +#define p_atomic_add_return(_v, _i) (*(_v) = *(_v) + (_i)) #define p_atomic_cmpxchg(_v, _old, _new) (*(_v) == (_old) ? (*(_v) = (_new), (_old)) : *(_v)) #endif