Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8294817

Define and specify Runtime shutdown sequence

XMLWordPrintable

    • Icon: CSR CSR
    • Resolution: Approved
    • Icon: P4 P4
    • 20
    • core-libs
    • None
    • behavioral
    • minimal
    • Hide
      The changes bring the specifications into alignment with existing long-standing behavior. No changes to the current behavior of OpenJDK are required. It is possible that other implementations will fall out of compliance, though this is unlikely since these behaviors are quite well-established.
      Show
      The changes bring the specifications into alignment with existing long-standing behavior. No changes to the current behavior of OpenJDK are required. It is possible that other implementations will fall out of compliance, though this is unlikely since these behaviors are quite well-established.
    • Java API, Other
    • SE

      Summary

      Update the java.lang.Runtime class specification to describe the shutdown sequence.

      Problem

      The shutdown hooks mechanism was added in JDK 1.3. This allowed some special "hooks" (really, threads) to be run after System.exit was called but before the JVM actually terminated. Unfortunately, documentation of the exact behavior of hooks with respect to the actual shutdown and exit of the JVM was piecemeal, and there were several places in the specifications that had misleading or out-of-date information, such as statements that "The System.exit() method terminates the JVM." Similarly out-of-date information was present in the JLS, the JVMS, and the JNI Specifications.

      Solution

      Update the java.lang.Runtime class specification to define the shutdown sequence, what causes it to start, and what happens when it finishes (or not). Also make minor adjustments to various places in Thread and System.

      Note that corresponding changes to other specifications are also being made:

      Specification

      See attached specdiff.

            smarks Stuart Marks
            smarks Stuart Marks
            Alan Bateman, David Holmes
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: