< prev index next >
src/java.base/share/classes/sun/nio/ch/SocketChannelImpl.java
Print this page
*** 378,388 ****
// clause will notice that the channel has been closed and
// throw an appropriate exception (AsynchronousCloseException
// or ClosedByInterruptException) if necessary.
//
// *There is A fourth possibility. implCloseSelectableChannel()
! // invokes nd.preClose(), signals reader/writer thred and quickly
// moves on to nd.close() in kill(), which does a real close.
// Then a third thread accepts a new connection, opens file or
// whatever that causes the released "fd" to be recycled. All
// above happens just between our last isOpen() check and the
// next kernel read reached, with the recycled "fd". The solution
--- 378,388 ----
// clause will notice that the channel has been closed and
// throw an appropriate exception (AsynchronousCloseException
// or ClosedByInterruptException) if necessary.
//
// *There is A fourth possibility. implCloseSelectableChannel()
! // invokes nd.preClose(), signals reader/writer thread and quickly
// moves on to nd.close() in kill(), which does a real close.
// Then a third thread accepts a new connection, opens file or
// whatever that causes the released "fd" to be recycled. All
// above happens just between our last isOpen() check and the
// next kernel read reached, with the recycled "fd". The solution
< prev index next >