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

Threads attached via JNI attach prevent daemon ThreadGroups from being destroyed

XMLWordPrintable

    • b130
    • generic
    • generic
    • Not verified

      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.

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

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: