[Haskell-cafe] BlockedIndefinitelyOnMVar exception
Gregory Collins
greg at gregorycollins.net
Thu Mar 31 12:03:09 CEST 2011
I find this behaviour a little annoying. Sometimes I *want* the thread
to block indefinitely! I.e. I want it to block until it receives a
KillThread exception. Is there a better way to accomplish that without
waiting on an MVar which will never fill? As a workaround what I've
been doing lately is stashing another reference to the mvar somewhere
else (I'm guessing the trigger condition for
"BlockedIndefinitelyOnMVar" is "blocked and mvar refcount == 1").
G
On Thu, Mar 31, 2011 at 11:41 AM, Edward Z. Yang <ezyang at mit.edu> wrote:
> I don't know if there's a way to disable it, but you can wrap all your
> spawned threads with an exception handler that catches BlockedIndefinitelyOnMVar
> and ignores it. If the thread blocks indefinitely, it's as good as dead,
> so there won't be any difference in behavior.
>
> Cheers,
> Edward
>
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
--
Gregory Collins <greg at gregorycollins.net>
More information about the Haskell-Cafe
mailing list