summaryrefslogtreecommitdiffstats
path: root/java
diff options
context:
space:
mode:
authorglewis <glewis@FreeBSD.org>2006-11-06 19:54:00 +0000
committerglewis <glewis@FreeBSD.org>2006-11-06 19:54:00 +0000
commitf6be95c03c10033582b3fac0cbc2ba8afbbeca11 (patch)
tree33ec211d307d265bfdd30fc5b5abdb096f773a1d /java
parent7c31df71ade5b92a08f0e7e56369151d337b25a5 (diff)
downloadFreeBSD-ports-f6be95c03c10033582b3fac0cbc2ba8afbbeca11.zip
FreeBSD-ports-f6be95c03c10033582b3fac0cbc2ba8afbbeca11.tar.gz
. 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')
-rw-r--r--java/jdk15/Makefile2
-rw-r--r--java/jdk15/files/patch-vm::os_bsd.cpp32
-rw-r--r--java/jdk16/Makefile2
-rw-r--r--java/jdk16/files/patch-vm::os_bsd.cpp32
4 files changed, 66 insertions, 2 deletions
diff --git a/java/jdk15/Makefile b/java/jdk15/Makefile
index 948ad8b..680b1f6 100644
--- a/java/jdk15/Makefile
+++ b/java/jdk15/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/jdk15/files/patch-vm::os_bsd.cpp b/java/jdk15/files/patch-vm::os_bsd.cpp
index 25bd71d..f9d9f79 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() {
diff --git a/java/jdk16/Makefile b/java/jdk16/Makefile
index 948ad8b..680b1f6 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 25bd71d..f9d9f79 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() {
OpenPOWER on IntegriCloud