<p dir="ltr">You can make a stable name for the MVar which will prevent the rts from collecting it. Google it, there was a thread about this with Simon Marlow.</p>
<p dir="ltr">Robin</p>
<br><div class="gmail_quote"><div dir="ltr">On Wed, Aug 5, 2015, 12:43 PM David Turner <<a href="mailto:dct25-561bs@mythic-beasts.com">dct25-561bs@mythic-beasts.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi,<div><br></div><div>Is there an elegant way to have a thread wait for an async exception but nothing else? I tend to do something like</div><div><br></div><div>    forever $ threadDelay 1000000000</div><div><br></div><div>but this seems like a bit of a hack. Waiting on an otherwise-unused MVar or doing 'atomically retry' don't work because GHC kills them off straight away.</div><div><br></div><div>The context is when using an API that only has a 'withMyThingy' wrapper and no explicit openMyThingy and closeMyThingy alternatives. Perhaps that's an API problem and the only way to work around this is with something a bit hacky?</div><div><br></div><div>Cheers,</div><div><br></div><div><br></div></div>
_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org" target="_blank">Haskell-Cafe@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe</a><br>
</blockquote></div>