how to catch GHC "no threads to run" exception?

Volker Stolz stolz@i2.informatik.rwth-aachen.de
Thu, 1 Aug 2002 11:27:06 +0200


In local.haskell, you wrote:
> test: no threads to run:  infinite loop or deadlock?
> My problem is that this behavior is actually desired, but
> how do I catch this exception and do some bookkeeping
> (closing external IO, etc.) and then a proper exit?

You can wrap the `takeMVar' with Exception.catch. Note that
Prelude.catch won't suffice.
-- 
http://www-i2.informatik.rwth-aachen.de/stolz/ *** PGP *** S/MIME
http://news.bbc.co.uk: The Israeli army destroyed the bomber's
family's house afterwards, a military statement said.