mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 06:45:07 +02:00
8334719: (se) Deferred close of SelectableChannel may result in a Selector doing the final close before concurrent I/O on channel has completed
Co-authored-by: Alan Bateman <alanb@openjdk.org> Reviewed-by: alanb, dfuchs
This commit is contained in:
parent
6682305ee2
commit
9bb675f89d
7 changed files with 705 additions and 0 deletions
|
@ -654,6 +654,9 @@ class ServerSocketChannelImpl
|
|||
|
||||
@Override
|
||||
public void kill() {
|
||||
// wait for any accept operation to complete before trying to close
|
||||
acceptLock.lock();
|
||||
acceptLock.unlock();
|
||||
synchronized (stateLock) {
|
||||
if (state == ST_CLOSING) {
|
||||
tryFinishClose();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue