< prev index next >
src/hotspot/share/runtime/thread.cpp
Print this page
rev 49501 : 8200374: Add ThreadsSMRSupport::verify_hazard_pointer_scanned() to verify threads_do().
@@ -103,10 +103,11 @@
#include "services/management.hpp"
#include "services/memTracker.hpp"
#include "services/threadService.hpp"
#include "trace/traceMacros.hpp"
#include "trace/tracing.hpp"
+#include "trace/tracingExport.hpp"
#include "utilities/align.hpp"
#include "utilities/defaultStream.hpp"
#include "utilities/dtrace.hpp"
#include "utilities/events.hpp"
#include "utilities/macros.hpp"
@@ -3430,17 +3431,12 @@
X = (JavaThread*)prefetch_and_load_ptr((void**)MACRO_current_p, (intx)MACRO_scan_interval))
// All JavaThreads
#define ALL_JAVA_THREADS(X) DO_JAVA_THREADS(ThreadsSMRSupport::get_java_thread_list(), X)
-// All JavaThreads + all non-JavaThreads (i.e., every thread in the system)
-void Threads::threads_do(ThreadClosure* tc) {
- assert_locked_or_safepoint(Threads_lock);
- // ALL_JAVA_THREADS iterates through all JavaThreads
- ALL_JAVA_THREADS(p) {
- tc->do_thread(p);
- }
+// All non-JavaThreads (i.e., every non-JavaThread in the system).
+void Threads::non_java_threads_do(ThreadClosure* tc) {
// Someday we could have a table or list of all non-JavaThreads.
// For now, just manually iterate through them.
tc->do_thread(VMThread::vm_thread());
Universe::heap()->gc_threads_do(tc);
WatcherThread *wt = WatcherThread::watcher_thread();
@@ -3453,13 +3449,30 @@
// checking in some cases.
if (wt != NULL) {
tc->do_thread(wt);
}
+#if INCLUDE_TRACE
+ Thread* sampler_thread = TracingExport::get_sampler_thread();
+ if (sampler_thread != NULL) {
+ tc->do_thread(sampler_thread);
+ }
+#endif
+
// If CompilerThreads ever become non-JavaThreads, add them here
}
+// All JavaThreads + all non-JavaThreads (i.e., every thread in the system).
+void Threads::threads_do(ThreadClosure* tc) {
+ assert_locked_or_safepoint(Threads_lock);
+ // ALL_JAVA_THREADS iterates through all JavaThreads.
+ ALL_JAVA_THREADS(p) {
+ tc->do_thread(p);
+ }
+ non_java_threads_do(tc);
+}
+
void Threads::possibly_parallel_threads_do(bool is_par, ThreadClosure* tc) {
int cp = Threads::thread_claim_parity();
ALL_JAVA_THREADS(p) {
if (p->claim_oops_do(is_par, cp)) {
tc->do_thread(p);
< prev index next >