mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 23:34:52 +02:00
8154715: Missing destructor and/or TLS clearing calls for terminating threads
Clear TLS on return from thread->run() unless already done. Prohibit asynchronous thread deletion. Reviewed-by: stefank, sspitsyn
This commit is contained in:
parent
cdc0b9792f
commit
0e8376bd17
9 changed files with 116 additions and 52 deletions
|
@ -226,16 +226,12 @@ void VMThread::create() {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
VMThread::VMThread() : NamedThread() {
|
||||
set_name("VM Thread");
|
||||
}
|
||||
|
||||
void VMThread::destroy() {
|
||||
if (_vm_thread != NULL) {
|
||||
delete _vm_thread;
|
||||
_vm_thread = NULL; // VM thread is gone
|
||||
}
|
||||
_vm_thread = NULL; // VM thread is gone
|
||||
}
|
||||
|
||||
void VMThread::run() {
|
||||
|
@ -308,9 +304,9 @@ void VMThread::run() {
|
|||
_terminate_lock->notify();
|
||||
}
|
||||
|
||||
// Deletion must be done synchronously by the JNI DestroyJavaVM thread
|
||||
// so that the VMThread deletion completes before the main thread frees
|
||||
// up the CodeHeap.
|
||||
// We are now racing with the VM termination being carried out in
|
||||
// another thread, so we don't "delete this". Numerous threads don't
|
||||
// get deleted when the VM terminates
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue