src/java.base/share/classes/java/lang/Shutdown.java
changeset 49176 f413e471a6ab
parent 47216 71c04702a3d5
child 49186 b8bfadfacded
--- a/src/java.base/share/classes/java/lang/Shutdown.java	Tue Feb 27 14:15:30 2018 +0100
+++ b/src/java.base/share/classes/java/lang/Shutdown.java	Tue Feb 13 15:48:23 2018 +0100
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1999, 2005, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1999, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -130,6 +130,9 @@
         }
     }
 
+    /* Notify the VM that it's time to halt. */
+    static native void beforeHalt();
+
     /* The halt method is synchronized on the halt lock
      * to avoid corruption of the delete-on-shutdown file list.
      * It invokes the true native halt method.
@@ -209,6 +212,7 @@
             /* Synchronize on the class object, causing any other thread
              * that attempts to initiate shutdown to stall indefinitely
              */
+            beforeHalt();
             sequence();
             halt(status);
         }