Fix #4514 - IO manager deadlock
authorBryan O'Sullivan <bos@serpentine.com>
Fri, 26 Nov 2010 23:28:10 +0000 (23:28 +0000)
committerBryan O'Sullivan <bos@serpentine.com>
Fri, 26 Nov 2010 23:28:10 +0000 (23:28 +0000)
commit40fe562f6d01f6076bf00a267dd24f57b45a1933
tree8cab2364e5dbefc0b07670ed549f357b8422386f
parentec7d7ba5e16fddc419a5f0da82a66764f5537c55
Fix #4514 - IO manager deadlock

* The public APIs for threadWaitRead and threadWaitWrite remain unchanged,
  and now throw an IOError if a file descriptor is closed behind their
  backs.  This behaviour is documented.

* The GHC.Conc API is extended to add a closeFd function, the behaviour
  of which is documented.

* Behind the scenes, we add a new evtClose event, which is used only when
  one thread closes a file descriptor that other threads are blocking on.

* Both base's IO code and network use the new closeFd function.
Control/Concurrent.hs
GHC/Conc.lhs
GHC/Conc/IO.hs
GHC/IO/FD.hs
System/Event.hs
System/Event/Internal.hs
System/Event/Manager.hs
System/Event/Thread.hs