From 3ca7ecb57eefc43b4347e22ad2fd7a4962d84020 Mon Sep 17 00:00:00 2001 From: Ryan Newton Date: Thu, 29 Mar 2012 00:32:03 -0400 Subject: add casArray# primop, similar to casMutVar# but for array elements --- compiler/prelude/primops.txt.pp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'compiler/prelude') diff --git a/compiler/prelude/primops.txt.pp b/compiler/prelude/primops.txt.pp index e275b23778..6e25d65488 100644 --- a/compiler/prelude/primops.txt.pp +++ b/compiler/prelude/primops.txt.pp @@ -794,6 +794,14 @@ primop ThawArrayOp "thawArray#" GenPrimOp has_side_effects = True code_size = { primOpCodeSizeForeignCall + 4 } +primop CasArrayOp "casArray#" GenPrimOp + MutableArray# s a -> Int# -> a -> a -> State# s -> (# State# s, Int#, a #) + {Unsafe, machine-level atomic compare and swap on an element within an Array.} + with + out_of_line = True + has_side_effects = True + + ------------------------------------------------------------------------ section "Byte Arrays" {Operations on {\tt ByteArray\#}. A {\tt ByteArray\#} is a just a region of -- cgit v1.2.1