comparison src/os/solaris/vm/os_solaris.cpp @ 1967:22260322f0be

6751923: JNDI wake up when clock_settime() is called Summary: Ported Chris Phillips' patch from jdk5 to jdk7 Reviewed-by: chrisphi, coleenp
author zgu
date Thu, 18 Nov 2010 14:37:46 -0500
parents b6aedd1acdc0
children f95d63e2154a
comparison
equal deleted inserted replaced
1958:13fee5052895 1967:22260322f0be
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. */