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

(thread) Thread.stop for main method thread ignored

    XMLWordPrintable

Details

    • b61
    • generic
    • generic

    Description

      The VM-created and started main method thread (and only that thread) will not stop in response to Thread.stop being invoked for it.

      The regression was caused by this test:

      /net/sqe/global/nfs/sec/ws_6.0_int/security/src/Permissions/threadGroupStopTest

      This regression was caused by a side effect of the fix for CR 4519200 ("(thread) Started
      thread does not terminate immediately if it was stopped before").

      The main method thread never gets it's Thread.start method invoked. Because of
      that, Thread.state is never set to "true" for the main method thread,
      sabotaging the logic in Thread.stop to correctly handle the "being stopped
      before it was ever started" detail of the stop method's specification. This also means
      that the check of the started field at the beginning of the Thread.start method is
      redundant or we'd have been missing the part of the spec that says you can't start a
      thread twice for the main method thread. The VM redundantly does this check and throws IllegalStateException for this case so this check in the library is only to prevent a
      thread from being added to its ThreadGroup instance twice.

      Attachments

        Issue Links

          Activity

            People

              psoper Pete Soper (Inactive)
              psoper Pete Soper (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: