How to get BlockedOnDeadMVar exception?

Simon Marlow [email protected]
Fri, 13 Oct 2000 04:01:00 -0700


> I didn't succeed in getting (or catching?) this exception through an
> obvious example. Is this exception thrown at all or just NYI?
> 
> Is this exception thrown at all or just NYI?

Sure it's implemented.  However, a main thread will never get this exception
(at the moment).  Try this example in 4.08.1:

module Main where

import Exception
import Concurrent

main = do
  id <- myThreadId
  forkIO (catchAllIO (do m <- newEmptyMVar; takeMVar m)
                (\e -> raiseInThread id e))
  catchAllIO (print (sum [1..1000000]))
        (\e -> print e)

Cheers,
	Simon