195 |
if (sm != null) |
if (sm != null) |
196 |
sm.checkExit(status); |
sm.checkExit(status); |
197 |
|
|
198 |
if(runShutdownHooks()) |
if (runShutdownHooks()) |
199 |
halt(status); |
halt(status); |
200 |
|
|
201 |
// Someone else already called runShutdownHooks(). |
// Someone else already called runShutdownHooks(). |
206 |
if (shutdownHooks != null) |
if (shutdownHooks != null) |
207 |
{ |
{ |
208 |
shutdownHooks.remove(Thread.currentThread()); |
shutdownHooks.remove(Thread.currentThread()); |
209 |
|
// Shutdown hooks are still running, so we clear status to |
210 |
|
// make sure we don't halt. |
211 |
|
status = 0; |
212 |
} |
} |
213 |
} |
} |
214 |
|
|
215 |
|
// If exit() is called again after the shutdown hooks have run, but |
216 |
|
// while finalization for exit is going on and the status is non-zero |
217 |
|
// we halt immediately. |
218 |
|
if (status != 0) |
219 |
|
halt(status); |
220 |
|
|
221 |
while (true) |
while (true) |
222 |
try |
try |
223 |
{ |
{ |