summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2020-10-29 22:55:15 -0400
committerBen Gamari <ben@smart-cactus.org>2020-10-30 14:02:19 -0400
commitf7b45cde43f47f94b77411477aabdb56f8f63d66 (patch)
treed07d2662001281e4d640de60c4f7f2f35cd3638d /includes
parent105d43db7bb7f399be3e5474d207e330d1b2da5a (diff)
downloadhaskell-f7b45cde43f47f94b77411477aabdb56f8f63d66.tar.gz
rts: Use relaxed ordering on spinlock counterswip/tsan/storage
Diffstat (limited to 'includes')
-rw-r--r--includes/stg/SMP.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/includes/stg/SMP.h b/includes/stg/SMP.h
index fa52a913c4..8eff276e60 100644
--- a/includes/stg/SMP.h
+++ b/includes/stg/SMP.h
@@ -440,6 +440,7 @@ load_load_barrier(void) {
// Relaxed atomic operations.
#define RELAXED_LOAD(ptr) __atomic_load_n(ptr, __ATOMIC_RELAXED)
#define RELAXED_STORE(ptr,val) __atomic_store_n(ptr, val, __ATOMIC_RELAXED)
+#define RELAXED_ADD(ptr,val) __atomic_add_fetch(ptr, val, __ATOMIC_RELAXED)
// Acquire/release atomic operations
#define ACQUIRE_LOAD(ptr) __atomic_load_n(ptr, __ATOMIC_ACQUIRE)
@@ -466,6 +467,7 @@ EXTERN_INLINE void load_load_barrier () {} /* nothing */
// Relaxed atomic operations
#define RELAXED_LOAD(ptr) *ptr
#define RELAXED_STORE(ptr,val) *ptr = val
+#define RELAXED_ADD(ptr,val) *ptr += val
// Acquire/release atomic operations
#define ACQUIRE_LOAD(ptr) *ptr