コード例 #1
0
 protected void implCloseSelectableChannel() throws IOException {
   synchronized (stateLock) {
     if (state != ST_KILLED) nd.preClose(fd);
     long th = thread;
     if (th != 0) NativeThread.signal(th);
     if (!isRegistered()) kill();
   }
 }
コード例 #2
0
 public void kill() throws IOException {
   synchronized (stateLock) {
     if (state == ST_KILLED) return;
     if (state == ST_UNINITIALIZED) {
       state = ST_KILLED;
       return;
     }
     assert !isOpen() && !isRegistered();
     nd.close(fd);
     state = ST_KILLED;
   }
 }