< prev index next >

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

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

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