equal
deleted
inserted
replaced
3373 } |
3373 } |
3374 |
3374 |
3375 // INTERRUPTIBLE_NORESTART_VM_ALWAYS returns res == OS_INTRPT for |
3375 // INTERRUPTIBLE_NORESTART_VM_ALWAYS returns res == OS_INTRPT for |
3376 // thread.Interrupt. |
3376 // thread.Interrupt. |
3377 |
3377 |
3378 if((res == OS_ERR) && (errno == EINTR)) { |
3378 // See c/r 6751923. Poll can return 0 before time |
|
3379 // has elapsed if time is set via clock_settime (as NTP does). |
|
3380 // res == 0 if poll timed out (see man poll RETURN VALUES) |
|
3381 // using the logic below checks that we really did |
|
3382 // sleep at least "millis" if not we'll sleep again. |
|
3383 if( ( res == 0 ) || ((res == OS_ERR) && (errno == EINTR))) { |
3379 newtime = getTimeMillis(); |
3384 newtime = getTimeMillis(); |
3380 assert(newtime >= prevtime, "time moving backwards"); |
3385 assert(newtime >= prevtime, "time moving backwards"); |
3381 /* Doing prevtime and newtime in microseconds doesn't help precision, |
3386 /* Doing prevtime and newtime in microseconds doesn't help precision, |
3382 and trying to round up to avoid lost milliseconds can result in a |
3387 and trying to round up to avoid lost milliseconds can result in a |
3383 too-short delay. */ |
3388 too-short delay. */ |