From eadba2766fd84bca0483aae28f738e13f90521cf Mon Sep 17 00:00:00 2001 From: simonm Date: Fri, 5 Jun 1998 11:51:45 +0000 Subject: [PATCH] [project @ 1998-06-05 11:51:44 by simonm] ChannelVar test. --- ghc/tests/concurrent/should_run/conc005.hs | 21 +++++++++++++++++++++ ghc/tests/concurrent/should_run/conc005.stdout | 1 + 2 files changed, 22 insertions(+) create mode 100644 ghc/tests/concurrent/should_run/conc005.hs create mode 100644 ghc/tests/concurrent/should_run/conc005.stdout diff --git a/ghc/tests/concurrent/should_run/conc005.hs b/ghc/tests/concurrent/should_run/conc005.hs new file mode 100644 index 0000000..5cbcca7 --- /dev/null +++ b/ghc/tests/concurrent/should_run/conc005.hs @@ -0,0 +1,21 @@ +module Main where + +import Concurrent + +-- same as conc004, but using the ChannelVar abstraction + +main = do + v <- newCVar + let + reader = do + c <- readCVar v + if (c == '\n') + then return () + else do putChar c; reader + + writer [] = do writeCVar v '\n'; return () + writer (c:cs) = do writeCVar v c; writer cs + + forkIO reader + writer "Hello World" + diff --git a/ghc/tests/concurrent/should_run/conc005.stdout b/ghc/tests/concurrent/should_run/conc005.stdout new file mode 100644 index 0000000..5e1c309 --- /dev/null +++ b/ghc/tests/concurrent/should_run/conc005.stdout @@ -0,0 +1 @@ +Hello World \ No newline at end of file -- 1.7.10.4