diff options
author | Greg Lewis <glewis@FreeBSD.org> | 2006-11-06 19:54:00 +0000 |
---|---|---|
committer | Greg Lewis <glewis@FreeBSD.org> | 2006-11-06 19:54:00 +0000 |
commit | 47f62ec7e7333d71f04ae8182a3dbed86beab0b6 (patch) | |
tree | 94197234269f4c1944f99eefa0663cbcd0607985 /java/jdk15/files | |
parent | . Fix a possible problem building the JDK in the GMT+0 time zone. When (diff) |
. Fix a problem with os_sleep returning early without raising an exception
when its called with interruptible set to false.
Submitted by: Kurt Miller <kurt@intricatesoftware.com>
Notes
Notes:
svn path=/head/; revision=176643
Diffstat (limited to 'java/jdk15/files')
-rw-r--r-- | java/jdk15/files/patch-vm::os_bsd.cpp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/java/jdk15/files/patch-vm::os_bsd.cpp b/java/jdk15/files/patch-vm::os_bsd.cpp index 25bd71db866c..f9d9f795f508 100644 --- a/java/jdk15/files/patch-vm::os_bsd.cpp +++ b/java/jdk15/files/patch-vm::os_bsd.cpp @@ -11,3 +11,35 @@ $FreeBSD$ #define EXTENSIONS_DIR "/lib/ext" #define ENDORSED_DIR "/lib/endorsed" +@@ -1968,16 +1968,23 @@ + + static int os_sleep(jlong millis, bool interruptible) { + int res; +- if (!interruptible) { +- do { +- res = os_nanosleep(&millis); +- } while ((res == OS_ERR) && (errno == EINTR) && (millis > 0)); +- } else { +- INTERRUPTIBLE_NORESTART_VM(os_nanosleep(&millis), res, os::Bsd::clear_interrupted); ++ ++ while (millis > 0) { ++ if (!interruptible) { ++ res = os_nanosleep(&millis); ++ } else { ++ INTERRUPTIBLE_NORESTART_VM(os_nanosleep(&millis), res, os::Bsd::clear_interrupted); ++ } ++ // INTERRUPTIBLE_NORESTART_VM returns res == OS_INTRPT for thread.Interrupt ++ ++ if((res == OS_ERR) && (errno == EINTR)) { ++ if(millis <= 0) ++ return OS_OK; ++ } else ++ return res; + } +- // INTERRUPTIBLE_NORESTART_VM returns res == OS_INTRPT for thread.Interrupt + +- return res; ++ return OS_OK; + } + + int os::Bsd::naked_sleep() { |