Simon Marlow wrote:
> You're right, this is a bug. But I'm not sure what to do about it: firstly,
> select returns EBADF with no indication of which particular fd is bad.
Yes, I see the problem.
>
> And secondly, should threadWaitRead just return, or should it raise an
> exception of some kind?
I think it should raise an exception.
> If it just returns, there's a good chance that the
> application will shortly attempt to read something from the fd and get an
> error. So one possibility is to just wake up all the threads currently
> blocked on I/O in the hope that the one with the bogus fd will soon die.
Could you make it "just return" but put a check in when threadWaitRead
returns which throws an exception if the Fd has disappeared?