< prev index next >

src/java.base/unix/classes/sun/nio/ch/SinkChannelImpl.java

Print this page

        

@@ -75,12 +75,13 @@
 
     public int getFDVal() {
         return fdVal;
     }
 
-    SinkChannelImpl(SelectorProvider sp, FileDescriptor fd) {
+    SinkChannelImpl(SelectorProvider sp, FileDescriptor fd) throws IOException {
         super(sp);
+        IOUtil.configureBlocking(fd, false);
         this.fd = fd;
         this.fdVal = IOUtil.fdVal(fd);
     }
 
     /**

@@ -121,12 +122,15 @@
             assert state < ST_CLOSING;
             state = ST_CLOSING;
             if (!tryClose()) {
                 long th = thread;
                 if (th != 0) {
+                    if (NativeThread.isFiber(th))
+                        Poller.stopPoll(fdVal);
                     nd.preClose(fd);
-                    NativeThread.signal(th);
+                    if (NativeThread.isKernelThread(th))
+                        NativeThread.signal(th);
                 }
             }
         }
     }
 
< prev index next >