jdk/src/macosx/classes/sun/nio/ch/KQueueArrayWrapper.java
changeset 22604 9b394795e216
parent 19607 bee007586d06
child 23010 6dadb192ad81
equal deleted inserted replaced
22603:816588059f9d 22604:9b394795e216
    51  * native function that actually sets the sizes and offsets of the fields based
    51  * native function that actually sets the sizes and offsets of the fields based
    52  * on which mode we're in.
    52  * on which mode we're in.
    53  */
    53  */
    54 
    54 
    55 class KQueueArrayWrapper {
    55 class KQueueArrayWrapper {
    56     // Event masks
       
    57     static final short POLLIN       = AbstractPollArrayWrapper.POLLIN;
       
    58     static final short POLLOUT      = AbstractPollArrayWrapper.POLLOUT;
       
    59 
       
    60     // kevent filters
    56     // kevent filters
    61     static short EVFILT_READ;
    57     static short EVFILT_READ;
    62     static short EVFILT_WRITE;
    58     static short EVFILT_WRITE;
    63 
    59 
    64     // kevent struct
    60     // kevent struct
   127 
   123 
   128         // This is all that's necessary based on inspection of usage:
   124         // This is all that's necessary based on inspection of usage:
   129         //   SinkChannelImpl, SourceChannelImpl, DatagramChannelImpl,
   125         //   SinkChannelImpl, SourceChannelImpl, DatagramChannelImpl,
   130         //   ServerSocketChannelImpl, SocketChannelImpl
   126         //   ServerSocketChannelImpl, SocketChannelImpl
   131         if (filter == EVFILT_READ) {
   127         if (filter == EVFILT_READ) {
   132             result |= POLLIN;
   128             result |= Net.POLLIN;
   133         } else if (filter == EVFILT_WRITE) {
   129         } else if (filter == EVFILT_WRITE) {
   134             result |= POLLOUT;
   130             result |= Net.POLLOUT;
   135         }
   131         }
   136 
   132 
   137         return result;
   133         return result;
   138     }
   134     }
   139 
   135 
   178             while ((u = updateList.poll()) != null) {
   174             while ((u = updateList.poll()) != null) {
   179                 SelChImpl ch = u.channel;
   175                 SelChImpl ch = u.channel;
   180                 if (!ch.isOpen())
   176                 if (!ch.isOpen())
   181                     continue;
   177                     continue;
   182 
   178 
   183                 register0(kq, ch.getFDVal(), u.events & POLLIN, u.events & POLLOUT);
   179                 register0(kq, ch.getFDVal(), u.events & Net.POLLIN, u.events & Net.POLLOUT);
   184             }
   180             }
   185         }
   181         }
   186     }
   182     }
   187 
   183 
   188 
   184