[Mesa-dev] [PATCH] util/atomic: Add p_atomic_add_return for the unlocked path
Jason Ekstrand
jason at jlekstrand.net
Thu Dec 5 17:50:50 UTC 2019
Fixes: 385d13f26d2 "util/atomic: Add a _return variant of p_atomic_add"
---
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.23.0
More information about the mesa-dev
mailing list