[project @ 2001-08-22 12:24:41 by simonmar]
[ghc-hetmet.git] / ghc / tests / concurrent / should_run / conc007.hs
diff --git a/ghc/tests/concurrent/should_run/conc007.hs b/ghc/tests/concurrent/should_run/conc007.hs
deleted file mode 100644 (file)
index 77421ca..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-{-# OPTIONS -fglasgow-exts #-}
-
-module Main where
-
-import Concurrent
-import Exception
-import IOExts
-
-choose :: a -> a -> IO a
-choose a b = do
-   ready <- newMVar ()
-   answer <- newEmptyMVar
-   a_id <- myForkIO (a `seq` takeMVar ready >> putMVar answer a)
-   b_id <- myForkIO (b `seq` takeMVar ready >> putMVar answer b)
-   it <- takeMVar answer
-   killThread a_id
-   killThread b_id
-   return it
-
--- We need to catch the exception raised by killThread and ignore it.
--- Otherwise the default handler will exit the program when this
--- exception is raised in any thread.
-
-myForkIO :: IO () -> IO ThreadId
-myForkIO io = forkIO (Exception.catch io (\e -> return ()))
-
-main = do
-   let big = sum [1..]
-       small = sum [1..42]
-   test1 <- choose big small
-   test2 <- choose small big
-   print (test1,test2)