#-----------------------------------------------------------------------------
-# $Id: Makefile,v 1.3 2000/03/13 11:39:22 simonmar Exp $
+# $Id: Makefile,v 1.4 2000/03/21 15:54:25 simonmar Exp $
TOP = ../..
include $(TOP)/mk/boilerplate.mk
include $(TOP)/mk/should_run.mk
conc009_RUNTEST_OPTS = -x 1
-conc018_RUNTEST_OPTS = -x 1
SRC_HC_OPTS += -dcore-lint -syslib concurrent -fglasgow-exts
forkIO (do { takeMVar m; raiseInThread main_thread (ErrorCall "foo") })
(error "wibble")
`catchAllIO` (\e -> do putMVar m ()
- threadDelay 500000
- putStrLn "done.")
+ sum [1..10000] `seq` putStrLn "done.")
(threadDelay 500000)
`catchAllIO` (\e -> putStrLn ("caught: " ++ show e))
( do
blockAsyncExceptions (do
putMVar m ()
- threadDelay 500000
- (unblockAsyncExceptions (threadDelay 500000))
+ sum [1..10000] `seq` -- give 'foo' a chance to be raised
+ (unblockAsyncExceptions (threadDelay 500000))
`catchAllIO` (\e -> putStrLn ("caught1: " ++ show e))
)
takeMVar m2
)
blockAsyncExceptions (do
putMVar m ()
- threadDelay 500000 -- to be sure the other thread is now blocked
- killThread sub_thread
+ sum [1..10000] `seq` -- to be sure the other thread is now blocked
+ killThread sub_thread
)
putStrLn "ok"
) `catchAllIO` (\e -> putStrLn ("caught1: " ++ show e))
putMVar m2 ()
-- blocked here, "bar" can't be delivered
- (threadDelay 100000)
+ (sum [1..10000] `seq` return ())
`catchAllIO` (\e -> putStrLn ("caught2: " ++ show e))
)
-- unblocked here, "bar" delivered to "caught3"
import Concurrent
+import Exception
main = do
- catch (do
+ catchAllIO (do
m <- newMVar ()
putMVar m ()
)
--- /dev/null
+putMVar: full MVar