private void updateRegistrations(){
synchronized (updateLock) {
    int j=0;
    while (j < updateCount) {
      int fd=updateDescriptors[j];
      short events=getUpdateEvents(fd);
      boolean isRegistered=registered.get(fd);
      int opcode=0;
      if (events != KILLED) {
        if (isRegistered) {
          opcode=(events != 0) ? EPOLL_CTL_MOD : EPOLL_CTL_DEL;
        }
 else {
          opcode=(events != 0) ? EPOLL_CTL_ADD : 0;
        }
        if (opcode != 0) {
          epollCtl(epfd,opcode,fd,events);
          if (opcode == EPOLL_CTL_ADD) {
            registered.set(fd);
          }
 else           if (opcode == EPOLL_CTL_DEL) {
            registered.clear(fd);
          }
        }
      }
      j++;
    }
    updateCount=0;
  }
}

private void updateRegistrations ( ) { synchronized ( updateLock ) { int j = 0 ; while ( j < updateCount ) { int fd = updateDescriptors [ j ] ; short events = getUpdateEvents ( fd ) ; boolean isRegistered = registered . get ( fd ) ; int opcode = 0 ; if ( events != KILLED ) { if ( isRegistered ) { opcode = ( events != 0 ) ? EPOLL_CTL_MOD : EPOLL_CTL_DEL ; } else { opcode = ( events != 0 ) ? EPOLL_CTL_ADD : 0 ; } if ( opcode != 0 ) { epollCtl ( epfd , opcode , fd , events ) ; if ( opcode == EPOLL_CTL_ADD ) { registered . set ( fd ) ; } else if ( opcode == EPOLL_CTL_DEL ) { registered . clear ( fd ) ; } } } j ++ ; } updateCount = 0 ; } }
update the pending registrations .
