summaryrefslogtreecommitdiff
path: root/rts
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2019-09-28 17:37:35 +0000
committerBen Gamari <ben@smart-cactus.org>2020-10-24 21:01:33 -0400
commitd39bbd3dbd569d60c7f27f68a1f30885a30c3fa3 (patch)
tree556bcd3b18f437c512882d3e950b19375dd7adc6 /rts
parentbf1b0bc78da7dbe5f6fbda54b37a9cb165ff857f (diff)
downloadhaskell-d39bbd3dbd569d60c7f27f68a1f30885a30c3fa3.tar.gz
rts: Use relaxed atomics for whitehole spin stats
Diffstat (limited to 'rts')
-rw-r--r--rts/SMPClosureOps.h4
-rw-r--r--rts/ThreadPaused.c2
2 files changed, 3 insertions, 3 deletions
diff --git a/rts/SMPClosureOps.h b/rts/SMPClosureOps.h
index c73821a782..9b34d787e8 100644
--- a/rts/SMPClosureOps.h
+++ b/rts/SMPClosureOps.h
@@ -62,12 +62,12 @@ EXTERN_INLINE StgInfoTable *reallyLockClosure(StgClosure *p)
info = xchg((P_)(void *)&p->header.info, (W_)&stg_WHITEHOLE_info);
if (info != (W_)&stg_WHITEHOLE_info) return (StgInfoTable *)info;
#if defined(PROF_SPIN)
- ++whitehole_lockClosure_spin;
+ NONATOMIC_ADD(&whitehole_lockClosure_spin, 1);
#endif
busy_wait_nop();
} while (++i < SPIN_COUNT);
#if defined(PROF_SPIN)
- ++whitehole_lockClosure_yield;
+ NONATOMIC_ADD(&whitehole_lockClosure_yield, 1);
#endif
yieldThread();
} while (1);
diff --git a/rts/ThreadPaused.c b/rts/ThreadPaused.c
index 83c621e386..2a2b178575 100644
--- a/rts/ThreadPaused.c
+++ b/rts/ThreadPaused.c
@@ -331,7 +331,7 @@ threadPaused(Capability *cap, StgTSO *tso)
if (cur_bh_info != bh_info) {
bh_info = cur_bh_info;
#if defined(PROF_SPIN)
- ++whitehole_threadPaused_spin;
+ NONATOMIC_ADD(&whitehole_threadPaused_spin, 1);
#endif
busy_wait_nop();
goto retry;