Пример #1
0
  void updateRegistrations() {
    synchronized (updateList) {
      Update u = null;
      while ((u = updateList.poll()) != null) {
        SelChImpl ch = u.channel;
        if (!ch.isOpen()) continue;

        register0(kq, ch.getFDVal(), u.events & POLLIN, u.events & POLLOUT);
      }
    }
  }
Пример #2
0
  void release(SelChImpl channel) {
    synchronized (updateList) {
      // flush any pending updates
      for (Iterator<Update> it = updateList.iterator(); it.hasNext(); ) {
        if (it.next().channel == channel) {
          it.remove();
        }
      }

      // remove
      register0(kq, channel.getFDVal(), 0, 0);
    }
  }