diff options
author | Douglas Wilson <douglas.wilson@gmail.com> | 2020-12-17 06:43:35 +0000 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2020-12-19 02:15:19 -0500 |
commit | df8e6e904d35e9ada4e43abf398dfb8a301f1bfa (patch) | |
tree | bf3f23b4f609a9951f226c4bb242949b441466c1 /rts/WSDeque.c | |
parent | 173112cad82630b02eb91acb1f5fb91a96fa02b9 (diff) | |
download | haskell-df8e6e904d35e9ada4e43abf398dfb8a301f1bfa.tar.gz |
rts: Use weaker cas in WSDeque
The algorithm described in the referenced paper uses this slightly
weaker atomic op.
This is the first "exotic" cas we're using. I've added a macro in the
<ORDERING>_OP style to match existing ones.
Diffstat (limited to 'rts/WSDeque.c')
-rw-r--r-- | rts/WSDeque.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/rts/WSDeque.c b/rts/WSDeque.c index d930d848a4..4974dfa7a7 100644 --- a/rts/WSDeque.c +++ b/rts/WSDeque.c @@ -56,7 +56,8 @@ static inline bool cas_top(WSDeque *q, StgInt old, StgInt new) { - return (StgWord) old == cas((StgPtr) &q->top, (StgWord) old, (StgWord) new); + return (StgWord) old == SEQ_CST_RELAXED_CAS((StgPtr) &q->top, + (StgWord) old, (StgWord) new); } |