< prev index next >

src/java.base/linux/classes/sun/nio/ch/EPollSelectorImpl.java

Print this page
*** 113,11 ***
          try {
              begin(blocking);
  
              do {
                  long startTime = timedPoll ? System.nanoTime() : 0;
!                 numEntries = EPoll.wait(epfd, pollArrayAddress, NUM_EPOLLEVENTS, 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) {
--- 113,11 ---
          try {
              begin(blocking);
  
              do {
                  long startTime = timedPoll ? System.nanoTime() : 0;
!                 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) {

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