--- a/src/hotspot/share/runtime/thread.cpp Mon May 07 14:57:25 2018 +0200
+++ b/src/hotspot/share/runtime/thread.cpp Mon May 07 16:12:07 2018 +0200
@@ -114,9 +114,6 @@
#include "utilities/macros.hpp"
#include "utilities/preserveException.hpp"
#include "utilities/vmError.hpp"
-#if INCLUDE_PARALLELGC
-#include "gc/parallel/pcTasks.hpp"
-#endif
#if INCLUDE_JVMCI
#include "jvmci/jvmciCompiler.hpp"
#include "jvmci/jvmciRuntime.hpp"
@@ -3436,13 +3433,25 @@
// 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) {
+// All JavaThreads
+void Threads::java_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);
}
+}
+
+void Threads::java_threads_and_vm_thread_do(ThreadClosure* tc) {
+ assert_locked_or_safepoint(Threads_lock);
+ java_threads_do(tc);
+ tc->do_thread(VMThread::vm_thread());
+}
+
+// All JavaThreads + all non-JavaThreads (i.e., every thread in the system).
+void Threads::threads_do(ThreadClosure* tc) {
+ assert_locked_or_safepoint(Threads_lock);
+ java_threads_do(tc);
non_java_threads_do(tc);
}
@@ -4465,24 +4474,6 @@
possibly_parallel_threads_do(is_par, &tc);
}
-#if INCLUDE_PARALLELGC
-// Used by ParallelScavenge
-void Threads::create_thread_roots_tasks(GCTaskQueue* q) {
- ALL_JAVA_THREADS(p) {
- q->enqueue(new ThreadRootsTask(p));
- }
- q->enqueue(new ThreadRootsTask(VMThread::vm_thread()));
-}
-
-// Used by Parallel Old
-void Threads::create_thread_roots_marking_tasks(GCTaskQueue* q) {
- ALL_JAVA_THREADS(p) {
- q->enqueue(new ThreadRootsMarkingTask(p));
- }
- q->enqueue(new ThreadRootsMarkingTask(VMThread::vm_thread()));
-}
-#endif // INCLUDE_PARALLELGC
-
void Threads::nmethods_do(CodeBlobClosure* cf) {
ALL_JAVA_THREADS(p) {
// This is used by the code cache sweeper to mark nmethods that are active