< prev index next >

src/java.base/share/classes/sun/nio/ch/ServerSocketChannelImpl.java

Print this page
rev 49271 : [mq]: selector-cleanup

@@ -208,12 +208,10 @@
         return DefaultOptionsHolder.defaultOptions;
     }
 
     @Override
     public ServerSocketChannel bind(SocketAddress local, int backlog) throws IOException {
-        acceptLock.lock();
-        try {
             synchronized (stateLock) {
                 ensureOpen();
                 if (localAddress != null)
                     throw new AlreadyBoundException();
                 InetSocketAddress isa = (local == null)

@@ -225,13 +223,10 @@
                 NetHooks.beforeTcpBind(fd, isa.getAddress(), isa.getPort());
                 Net.bind(fd, isa.getAddress(), isa.getPort());
                 Net.listen(fd, backlog < 1 ? 50 : backlog);
                 localAddress = Net.localAddress(fd);
             }
-        } finally {
-            acceptLock.unlock();
-        }
         return this;
     }
 
     /**
      * Marks the beginning of an I/O operation that might block.
< prev index next >