Killing a thread when MVar is garbage collected

It will just work: when the MVar is only reachable by the thread that is blocked on it, then the thread is sent the BlockedIndefinitelyOnMVar exception, which will normally cause it to die silently (the default exception handler for a thread ignores this exception).

BTW, for doing some cleanup when the thread dies, you’ll want to use forkFinally (which I just added to Control.Concurrent).

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)