diff options
Diffstat (limited to 'compiler/prelude/primops.txt.pp')
-rw-r--r-- | compiler/prelude/primops.txt.pp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/compiler/prelude/primops.txt.pp b/compiler/prelude/primops.txt.pp index 739092d5f5..e5a3e216f1 100644 --- a/compiler/prelude/primops.txt.pp +++ b/compiler/prelude/primops.txt.pp @@ -1726,6 +1726,14 @@ primop AtomicReadMVarOp "atomicReadMVar#" GenPrimOp out_of_line = True has_side_effects = True +primop TryAtomicReadMVarOp "tryAtomicReadMVar#" GenPrimOp + MVar# s a -> State# s -> (# State# s, Int#, a #) + {If {\tt MVar\#} is empty, immediately return with integer 0 and value undefined. + Otherwise, return wtih integer 1 and contents of {\tt MVar\#}.} + with + out_of_line = True + has_side_effects = True + primop SameMVarOp "sameMVar#" GenPrimOp MVar# s a -> MVar# s a -> Bool |