From 752196a4938f92395bacba915f3240b88790145a Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Thu, 5 Dec 2019 11:49:18 -0600 Subject: [PATCH] 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 --- src/util/u_atomic.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- 2.30.2