< prev index next >

src/java.base/unix/classes/sun/nio/ch/PollSelectorImpl.java

Print this page
@@ -33,11 +33,10 @@
  import java.util.ArrayList;
  import java.util.Deque;
  import java.util.List;
  import java.util.concurrent.TimeUnit;
  import java.util.function.Consumer;
- 
  import jdk.internal.misc.Unsafe;
  
  /**
   * Selector implementation based on poll
   */

@@ -109,11 +108,11 @@
              begin(blocking);
  
              int numPolled;
              do {
                  long startTime = timedPoll ? System.nanoTime() : 0;
-                 numPolled = poll(pollArray.address(), pollArraySize, to);
+                 numPolled = poll(to);
                  if (numPolled == 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) {

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