summaryrefslogtreecommitdiff
path: root/includes
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2020-10-22 12:02:58 -0400
committerBen Gamari <ben@smart-cactus.org>2020-10-24 21:00:40 -0400
commit3416244b736b386f0bbf8369083f90110cd524a2 (patch)
tree2fba1c6e5ee086350dab52efd083c11e9ae3c96e /includes
parentdd175a926c0e9654cd6ac8d9d26b183540c87331 (diff)
downloadhaskell-3416244b736b386f0bbf8369083f90110cd524a2.tar.gz
Capabiliity: Properly fix data race on n_returning_tasks
There is a real data race but can be made safe by using proper atomic (but relaxed) accesses.
Diffstat (limited to 'includes')
-rw-r--r--includes/stg/SMP.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/includes/stg/SMP.h b/includes/stg/SMP.h
index fa52a913c4..9390c00eb1 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)