Thu, 18 Nov 2010 14:37:46 -0500
6751923: JNDI wake up when clock_settime() is called
Summary: Ported Chris Phillips' patch from jdk5 to jdk7
Reviewed-by: chrisphi, coleenp
src/os/solaris/vm/os_solaris.cpp | file | annotate | diff | comparison | revisions |
1.1 --- a/src/os/solaris/vm/os_solaris.cpp Wed Nov 17 09:21:51 2010 -0500 1.2 +++ b/src/os/solaris/vm/os_solaris.cpp Thu Nov 18 14:37:46 2010 -0500 1.3 @@ -3375,7 +3375,12 @@ 1.4 // INTERRUPTIBLE_NORESTART_VM_ALWAYS returns res == OS_INTRPT for 1.5 // thread.Interrupt. 1.6 1.7 - if((res == OS_ERR) && (errno == EINTR)) { 1.8 + // See c/r 6751923. Poll can return 0 before time 1.9 + // has elapsed if time is set via clock_settime (as NTP does). 1.10 + // res == 0 if poll timed out (see man poll RETURN VALUES) 1.11 + // using the logic below checks that we really did 1.12 + // sleep at least "millis" if not we'll sleep again. 1.13 + if( ( res == 0 ) || ((res == OS_ERR) && (errno == EINTR))) { 1.14 newtime = getTimeMillis(); 1.15 assert(newtime >= prevtime, "time moving backwards"); 1.16 /* Doing prevtime and newtime in microseconds doesn't help precision,