re PR classpath/26990 (SecurityManager.checkExit() problem)
PR libgcj/26990: * prims.cc (_Jv_RunMain): Use exitNoChecksAccessor. * gnu/java/lang/natMainThread.cc (call_main): Use exitNoChecksAccessor. * testsuite/libjava.lang/pr26990.out: New file. * testsuite/libjava.lang/pr26990.java: New file. * java/lang/Runtime.java (exitNoChecks): New method. (exitNoChecksAccessor): Likewise. (exit): Call exitNoChecks. From-SVN: r112685
This commit is contained in:
parent
4b1c1f6fc2
commit
119afc377a
6 changed files with 40 additions and 5 deletions
|
@ -146,9 +146,20 @@ public class Runtime
|
|||
SecurityManager sm = SecurityManager.current; // Be thread-safe!
|
||||
if (sm != null)
|
||||
sm.checkExit(status);
|
||||
exitNoChecks(status);
|
||||
}
|
||||
|
||||
// Accessor to avoid adding a vtable slot.
|
||||
static void exitNoChecksAccessor(int status)
|
||||
{
|
||||
current.exitNoChecks(status);
|
||||
}
|
||||
|
||||
// Private since we can't add a vtable slot in 4.1.x.
|
||||
private void exitNoChecks(int status)
|
||||
{
|
||||
if (runShutdownHooks())
|
||||
halt(status);
|
||||
exitInternal(status);
|
||||
|
||||
// Someone else already called runShutdownHooks().
|
||||
// Make sure we are not/no longer in the shutdownHooks set.
|
||||
|
@ -171,7 +182,7 @@ public class Runtime
|
|||
// while finalization for exit is going on and the status is non-zero
|
||||
// we halt immediately.
|
||||
if (status != 0)
|
||||
halt(status);
|
||||
exitInternal(status);
|
||||
|
||||
while (true)
|
||||
try
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue