summaryrefslogtreecommitdiff
path: root/vm/reference/java
diff options
context:
space:
mode:
authorJeroen Frijters <jeroen@sumatra.nl>2003-11-21 15:18:31 +0000
committerJeroen Frijters <jeroen@sumatra.nl>2003-11-21 15:18:31 +0000
commite0b22bf5f3cafa30ada91dd3840ba8fc619250ec (patch)
tree9347cb4ab71d80151d5c0a07fcf7987ca535e9f3 /vm/reference/java
parent800215bddf48d4b54f0f0a761ca37c64a899477d (diff)
downloadclasspath-e0b22bf5f3cafa30ada91dd3840ba8fc619250ec.tar.gz
Fixed bug introduced in earlier check in today.
Diffstat (limited to 'vm/reference/java')
-rwxr-xr-xvm/reference/java/lang/Runtime.java13
1 files changed, 11 insertions, 2 deletions
diff --git a/vm/reference/java/lang/Runtime.java b/vm/reference/java/lang/Runtime.java
index 2bf4bc98c..508901c7e 100755
--- a/vm/reference/java/lang/Runtime.java
+++ b/vm/reference/java/lang/Runtime.java
@@ -195,7 +195,7 @@ public class Runtime
if (sm != null)
sm.checkExit(status);
- if(runShutdownHooks())
+ if (runShutdownHooks())
halt(status);
// Someone else already called runShutdownHooks().
@@ -206,9 +206,18 @@ public class Runtime
if (shutdownHooks != null)
{
shutdownHooks.remove(Thread.currentThread());
+ // Shutdown hooks are still running, so we clear status to
+ // make sure we don't halt.
+ status = 0;
}
}
-
+
+ // If exit() is called again after the shutdown hooks have run, but
+ // while finalization for exit is going on and the status is non-zero
+ // we halt immediately.
+ if (status != 0)
+ halt(status);
+
while (true)
try
{