[project @ 2002-12-05 12:36:54 by simonmar]
[ghc-hetmet.git] / ghc / compiler / prelude / primops.txt.pp
index a1ff417..59d6dae 100644 (file)
@@ -1,5 +1,5 @@
 -----------------------------------------------------------------------
--- $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
 --
@@ -1274,6 +1274,18 @@ primop  SameMutVarOp "sameMutVar#" GenPrimOp
    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"
 ------------------------------------------------------------------------
@@ -1442,7 +1454,7 @@ primop  MyThreadIdOp "myThreadId#" GenPrimOp
    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