-----------------------------------------------------------------------
--- $Id: primops.txt.pp,v 1.20 2002/06/18 13:58:24 simonpj Exp $
+-- $Id: primops.txt.pp,v 1.22 2002/10/18 09:51:04 simonmar Exp $
--
-- Primitive Operations
--
with
usage = { mangle SameMutVarOp [mkP, mkP] mkM }
+-- not really the right type, but we don't know about pairs here. The
+-- correct type is
+--
+-- MutVar# s a -> (a -> (a,b)) -> State# s -> (# State# s, b #)
+--
+primop AtomicModifyMutVarOp "atomicModifyMutVar#" GenPrimOp
+ MutVar# s a -> (a -> b) -> State# s -> (# State# s, c #)
+ with
+ usage = { mangle AtomicModifyMutVarOp [mkP, mkM, mkP] mkM }
+ has_side_effects = True
+ out_of_line = True
+
------------------------------------------------------------------------
section "Exceptions"
------------------------------------------------------------------------
out_of_line = True
primop LabelThreadOp "labelThread#" GenPrimOp
- Addr# -> State# RealWorld -> State# RealWorld
+ ThreadId# -> Addr# -> State# RealWorld -> State# RealWorld
with
has_side_effects = True
out_of_line = True