コード例 #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;
   }
 }
コード例 #3
0
  protected void implCloseSelectableChannel() throws IOException {
    synchronized (stateLock) {
      if (state != ST_KILLED) nd.preClose(fd);
      ResourceManager.afterUdpClose();

      // if member of mulitcast group then invalidate all keys
      if (registry != null) registry.invalidateAll();

      long th;
      if ((th = readerThread) != 0) NativeThread.signal(th);
      if ((th = writerThread) != 0) NativeThread.signal(th);
      if (!isRegistered()) kill();
    }
  }