OpenJDK / amber / amber
changeset 7392:27133691a020
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 | cbd66f8db06b |
children | 3ca6a3ec6699 |
files | hotspot/src/os/solaris/vm/os_solaris.cpp |
diffstat | 1 files changed, 6 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/hotspot/src/os/solaris/vm/os_solaris.cpp Wed Nov 17 09:21:51 2010 -0500 +++ b/hotspot/src/os/solaris/vm/os_solaris.cpp Thu Nov 18 14:37:46 2010 -0500 @@ -3375,7 +3375,12 @@ // INTERRUPTIBLE_NORESTART_VM_ALWAYS returns res == OS_INTRPT for // thread.Interrupt. - if((res == OS_ERR) && (errno == EINTR)) { + // See c/r 6751923. Poll can return 0 before time + // has elapsed if time is set via clock_settime (as NTP does). + // res == 0 if poll timed out (see man poll RETURN VALUES) + // using the logic below checks that we really did + // sleep at least "millis" if not we'll sleep again. + if( ( res == 0 ) || ((res == OS_ERR) && (errno == EINTR))) { newtime = getTimeMillis(); assert(newtime >= prevtime, "time moving backwards"); /* Doing prevtime and newtime in microseconds doesn't help precision,