< prev index next >

src/java.base/macosx/classes/sun/nio/ch/KQueueSelectorImpl.java

Print this page
@@ -117,11 +117,11 @@
          try {
              begin(blocking);
  
              do {
                  long startTime = timedPoll ? System.nanoTime() : 0;
-                 numEntries = KQueue.poll(kqfd, pollArrayAddress, MAX_KEVENTS, to);
+                 numEntries = poll(to);
                  if (numEntries == IOStatus.INTERRUPTED && timedPoll) {
                      // timed poll interrupted so need to adjust timeout
                      long adjust = System.nanoTime() - startTime;
                      to -= TimeUnit.MILLISECONDS.convert(adjust, TimeUnit.NANOSECONDS);
                      if (to <= 0) {

@@ -137,10 +137,15 @@
          }
          processDeregisterQueue();
          return processEvents(numEntries, action);
      }
  
+     @Override
+     protected int implPoll(long timeout) throws IOException {
+         return KQueue.poll(kqfd, pollArrayAddress, MAX_KEVENTS, timeout);
+     }
+ 
      /**
       * Process changes to the interest ops.
       */
      private void processUpdateQueue() {
          assert Thread.holdsLock(this);
< prev index next >