< prev index next > src/java.base/unix/classes/sun/nio/ch/PollSelectorImpl.java
Print this page
begin(blocking);
int numPolled;
do {
long startTime = timedPoll ? System.nanoTime() : 0;
! long comp = Blocker.begin();
try {
numPolled = poll(pollArray.address(), pollArraySize, to);
} finally {
! Blocker.end(comp);
}
if (numPolled == IOStatus.INTERRUPTED && timedPoll) {
// timed poll interrupted so need to adjust timeout
long adjust = System.nanoTime() - startTime;
to -= (int) TimeUnit.NANOSECONDS.toMillis(adjust);
begin(blocking);
int numPolled;
do {
long startTime = timedPoll ? System.nanoTime() : 0;
! boolean attempted = Blocker.begin(blocking);
try {
numPolled = poll(pollArray.address(), pollArraySize, to);
} finally {
! Blocker.end(attempted);
}
if (numPolled == IOStatus.INTERRUPTED && timedPoll) {
// timed poll interrupted so need to adjust timeout
long adjust = System.nanoTime() - startTime;
to -= (int) TimeUnit.NANOSECONDS.toMillis(adjust);
< prev index next >