diff options
author | glewis <glewis@FreeBSD.org> | 2006-11-07 03:54:00 +0800 |
---|---|---|
committer | glewis <glewis@FreeBSD.org> | 2006-11-07 03:54:00 +0800 |
commit | f6be95c03c10033582b3fac0cbc2ba8afbbeca11 (patch) | |
tree | 33ec211d307d265bfdd30fc5b5abdb096f773a1d /java/jdk16 | |
parent | 7c31df71ade5b92a08f0e7e56369151d337b25a5 (diff) | |
download | freebsd-ports-gnome-f6be95c03c10033582b3fac0cbc2ba8afbbeca11.tar.gz freebsd-ports-gnome-f6be95c03c10033582b3fac0cbc2ba8afbbeca11.tar.zst freebsd-ports-gnome-f6be95c03c10033582b3fac0cbc2ba8afbbeca11.zip |
. 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>
Diffstat (limited to 'java/jdk16')
-rw-r--r-- | java/jdk16/Makefile | 2 | ||||
-rw-r--r-- | java/jdk16/files/patch-vm::os_bsd.cpp | 32 |
2 files changed, 33 insertions, 1 deletions
diff --git a/java/jdk16/Makefile b/java/jdk16/Makefile index 948ad8bf8a3d..680b1f6df1f2 100644 --- a/java/jdk16/Makefile +++ b/java/jdk16/Makefile @@ -7,7 +7,7 @@ PORTNAME= jdk PORTVERSION= ${JDK_VERSION}p${JDK_PATCHSET_VERSION} -PORTREVISION= 5 +PORTREVISION= 6 CATEGORIES= java devel MASTER_SITES= # http://www.sun.com/software/java2/download.html # http://www.eyesbeyond.com/freebsddom/java/jdk15.html diff --git a/java/jdk16/files/patch-vm::os_bsd.cpp b/java/jdk16/files/patch-vm::os_bsd.cpp index 25bd71db866c..f9d9f795f508 100644 --- a/java/jdk16/files/patch-vm::os_bsd.cpp +++ b/java/jdk16/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() { |