mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 07:14:30 +02:00
6740526: sun/management/HotspotThreadMBean/GetInternalThreads.java test failed
Reviewed-by: dholmes, dcubed
This commit is contained in:
parent
fe1d1630dc
commit
ec7f8bf1cb
1 changed files with 11 additions and 7 deletions
|
@ -2756,13 +2756,17 @@ void Threads::threads_do(ThreadClosure* tc) {
|
||||||
// For now, just manually iterate through them.
|
// For now, just manually iterate through them.
|
||||||
tc->do_thread(VMThread::vm_thread());
|
tc->do_thread(VMThread::vm_thread());
|
||||||
Universe::heap()->gc_threads_do(tc);
|
Universe::heap()->gc_threads_do(tc);
|
||||||
{
|
WatcherThread *wt = WatcherThread::watcher_thread();
|
||||||
// Grab the Terminator_lock to prevent watcher_thread from being terminated.
|
// Strictly speaking, the following NULL check isn't sufficient to make sure
|
||||||
MutexLockerEx mu(Terminator_lock, Mutex::_no_safepoint_check_flag);
|
// the data for WatcherThread is still valid upon being examined. However,
|
||||||
WatcherThread *wt = WatcherThread::watcher_thread();
|
// considering that WatchThread terminates when the VM is on the way to
|
||||||
if (wt != NULL)
|
// exit at safepoint, the chance of the above is extremely small. The right
|
||||||
tc->do_thread(wt);
|
// way to prevent termination of WatcherThread would be to acquire
|
||||||
}
|
// Terminator_lock, but we can't do that without violating the lock rank
|
||||||
|
// checking in some cases.
|
||||||
|
if (wt != NULL)
|
||||||
|
tc->do_thread(wt);
|
||||||
|
|
||||||
// If CompilerThreads ever become non-JavaThreads, add them here
|
// If CompilerThreads ever become non-JavaThreads, add them here
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue