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

paul@thev.net paul@thev.net
Fri, 2 Aug 2002 14:10:13 +0800


On Thu, Aug 01, 2002 at 11:27:06AM +0200, Volker Stolz wrote:
> 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.

Since I have 3 threads waiting on takeMVar, do I have to wrap
all of them with Exception.catch?

Regards,
.paul.