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

Threads attached via JNI attach prevent daemon ThreadGroups from being destroyed

    Details

    • Subcomponent:
    • Resolved In Build:
      b130
    • CPU:
      generic
    • OS:
      generic
    • Verification:
      Not verified

      Description

      When a thread attaches via JNI AttachCurrentThread(AsDaemon) the java.lang.Thread constructor is invoked, which calls init(), which calls group.addUnstarted(). Normally start() will call group.threadStarting() which calls add(t) and decrements the nUnstartedThreads count. But the JNI attach makes a direct call to group.add(t). Which means nUnstartedThreads is wrong and daemon ThreadGroups will never be destroyed when the last thread exits.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                chegar Chris Hegarty
                Reporter:
                chegar Chris Hegarty
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: