< prev index next >

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

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

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