Mercurial > hg > truffle
comparison src/share/vm/runtime/thread.cpp @ 323:b33eef719520
6740526: sun/management/HotspotThreadMBean/GetInternalThreads.java test failed
Reviewed-by: dholmes, dcubed
author | xlu |
---|---|
date | Mon, 25 Aug 2008 13:52:13 -0700 |
parents | 3529d0e8d09c |
children | 032ddb9432ad e4355b352b7d |
comparison
equal
deleted
inserted
replaced
297:f8068895c22d | 323:b33eef719520 |
---|---|
2754 } | 2754 } |
2755 // Someday we could have a table or list of all non-JavaThreads. | 2755 // Someday we could have a table or list of all non-JavaThreads. |
2756 // For now, just manually iterate through them. | 2756 // For now, just manually iterate through them. |
2757 tc->do_thread(VMThread::vm_thread()); | 2757 tc->do_thread(VMThread::vm_thread()); |
2758 Universe::heap()->gc_threads_do(tc); | 2758 Universe::heap()->gc_threads_do(tc); |
2759 { | 2759 WatcherThread *wt = WatcherThread::watcher_thread(); |
2760 // Grab the Terminator_lock to prevent watcher_thread from being terminated. | 2760 // Strictly speaking, the following NULL check isn't sufficient to make sure |
2761 MutexLockerEx mu(Terminator_lock, Mutex::_no_safepoint_check_flag); | 2761 // the data for WatcherThread is still valid upon being examined. However, |
2762 WatcherThread *wt = WatcherThread::watcher_thread(); | 2762 // considering that WatchThread terminates when the VM is on the way to |
2763 if (wt != NULL) | 2763 // exit at safepoint, the chance of the above is extremely small. The right |
2764 tc->do_thread(wt); | 2764 // way to prevent termination of WatcherThread would be to acquire |
2765 } | 2765 // Terminator_lock, but we can't do that without violating the lock rank |
2766 // checking in some cases. | |
2767 if (wt != NULL) | |
2768 tc->do_thread(wt); | |
2769 | |
2766 // If CompilerThreads ever become non-JavaThreads, add them here | 2770 // If CompilerThreads ever become non-JavaThreads, add them here |
2767 } | 2771 } |
2768 | 2772 |
2769 jint Threads::create_vm(JavaVMInitArgs* args, bool* canTryAgain) { | 2773 jint Threads::create_vm(JavaVMInitArgs* args, bool* canTryAgain) { |
2770 | 2774 |