Mercurial > hg > graal-jvmci-8
diff src/share/vm/runtime/thread.cpp @ 363:032ddb9432ad
Merge
author | apetrusenko |
---|---|
date | Wed, 17 Sep 2008 19:59:35 +0400 |
parents | 5d254928c888 b33eef719520 |
children | 99dd4bbd9eec |
line wrap: on
line diff
--- a/src/share/vm/runtime/thread.cpp Wed Sep 17 16:49:18 2008 +0400 +++ b/src/share/vm/runtime/thread.cpp Wed Sep 17 19:59:35 2008 +0400 @@ -2777,13 +2777,17 @@ // For now, just manually iterate through them. tc->do_thread(VMThread::vm_thread()); Universe::heap()->gc_threads_do(tc); - { - // Grab the Terminator_lock to prevent watcher_thread from being terminated. - MutexLockerEx mu(Terminator_lock, Mutex::_no_safepoint_check_flag); - WatcherThread *wt = WatcherThread::watcher_thread(); - if (wt != NULL) - tc->do_thread(wt); - } + WatcherThread *wt = WatcherThread::watcher_thread(); + // Strictly speaking, the following NULL check isn't sufficient to make sure + // the data for WatcherThread is still valid upon being examined. However, + // considering that WatchThread terminates when the VM is on the way to + // exit at safepoint, the chance of the above is extremely small. The right + // 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 }