Commit ca3a648b authored by Edward Z. Yang's avatar Edward Z. Yang

Add simple test for tryAtomicReadMVar.

Signed-off-by: Edward Z. Yang's avatarEdward Z. Yang <ezyang@mit.edu>
parent d8b1626f
......@@ -77,6 +77,7 @@ test('T5866', exit_code(1), compile_and_run, [''])
test('atomicReadMVar1', normal, compile_and_run, [''])
test('atomicReadMVar2', normal, compile_and_run, [''])
test('atomicReadMVar3', normal, compile_and_run, [''])
test('tryAtomicReadMVar1', normal, compile_and_run, [''])
# -----------------------------------------------------------------------------
# These tests we only do for a full run
......
module Main where
import GHC.MVar
import Control.Concurrent
main = do
m <- newMVar (0 :: Int)
Just 0 <- tryAtomicReadMVar m
takeMVar m
Nothing <- tryAtomicReadMVar m
return ()
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment