------- Comment #2 from daney at gcc dot gnu dot org 2006-10-26 17:56 ------- This is trickier than I initially thought.
You cannot remained blocked in accept() while holding a lock that protects closing the native_fd. Otherwise you will be blocked until a connection arrives (perhaps forever). If we can shutdown the socket without holding the lock, but not close it, there may be a path that will not deadlock. Not closing the native_fd is key as doing that allows the OS to open a new resource with the same fd. Which is the problem to be solved. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=29604