Relates :
|
|
Relates :
|
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.
|