Commit 2c35ccb0 authored by Edward Z. Yang's avatar Edward Z. Yang

Rename atomicReadMVar and friends to readMVar.

Signed-off-by: Edward Z. Yang's avatarEdward Z. Yang <ezyang@mit.edu>
parent 48ac948e
......@@ -74,10 +74,10 @@ test('T5611', normal, compile_and_run, [''])
test('T5238', normal, compile_and_run, [''])
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, [''])
test('readMVar1', normal, compile_and_run, [''])
test('readMVar2', normal, compile_and_run, [''])
test('readMVar3', normal, compile_and_run, [''])
test('tryReadMVar1', normal, compile_and_run, [''])
# -----------------------------------------------------------------------------
# These tests we only do for a full run
......
module Main where
import GHC.MVar
import Control.Concurrent
main = do
......@@ -8,7 +7,7 @@ main = do
m <- newMVar (0 :: Int)
let readloop 0 = return ()
readloop i = do
atomicReadMVar m
readMVar m
readloop (i-1)
writeloop 0 = return ()
writeloop i = do
......
module Main where
import GHC.MVar
import Control.Concurrent
main = do
m <- newEmptyMVar
sync <- newEmptyMVar
let f = atomicReadMVar m
let f = readMVar m
t1 <- forkIO (f >> error "FAILURE")
t2 <- forkIO (f >> putMVar sync ())
killThread t1
putMVar m (0 :: Int)
atomicReadMVar sync
readMVar sync
module Main where
import GHC.MVar
import Control.Concurrent
-- example from
......@@ -10,7 +9,7 @@ main = do
m <- newMVar (0 :: Int)
forkIO $ putMVar m 1
yield
r1 <- atomicReadMVar m
r1 <- readMVar m
r2 <- takeMVar m
r3 <- takeMVar m
return ()
module Main where
import GHC.MVar
import Control.Concurrent
main = do
m <- newMVar (0 :: Int)
Just 0 <- tryAtomicReadMVar m
Just 0 <- tryReadMVar m
takeMVar m
Nothing <- tryAtomicReadMVar m
Nothing <- tryReadMVar 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