Final bikeshedding call: Fixing Control.Exception.bracket

Eric Mertens emertens at gmail.com
Thu Nov 13 06:56:14 UTC 2014


Of course if you have a handle where you don't know if another thread is
using it and you want to close it and you want to protect against an
asynchronous exception from stopping you from closing one of these 3
mystery file descriptors you can wrap that particular hClose in an
uninterruptableMask.

On Wed, Nov 12, 2014 at 10:46 PM, Brandon Allbery <allbery.b at gmail.com>
wrote:

> On Wed, Nov 12, 2014 at 10:47 PM, Eric Mertens <emertens at gmail.com> wrote:
>
>> It's not vulnerable to the same issue because hClose can't block (as far
>> as I know) because it can't be in use at the time that clean up is running.
>>
>
> This sounds unsafe to me. System file descriptors are per process, and
> there are at least three such that *must* be per process (stdin, stdout,
> stderr). And, while closing those isn't especially common, it can be and is
> done sometimes. Can you guarantee that the corresponding handle's not in
> use?
>
> --
> brandon s allbery kf8nh                               sine nomine
> associates
> allbery.b at gmail.com
> ballbery at sinenomine.net
> unix, openafs, kerberos, infrastructure, xmonad
> http://sinenomine.net
>



-- 
Eric Mertens
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/libraries/attachments/20141112/89b45b1c/attachment.html>


More information about the Libraries mailing list