--- a/src/hotspot/share/gc/shared/threadLocalAllocBuffer.cpp Wed Nov 22 14:31:48 2017 -0500
+++ b/src/hotspot/share/gc/shared/threadLocalAllocBuffer.cpp Wed Nov 22 17:54:50 2017 -0800
@@ -30,6 +30,7 @@
#include "memory/universe.inline.hpp"
#include "oops/oop.inline.hpp"
#include "runtime/thread.inline.hpp"
+#include "runtime/threadSMR.hpp"
#include "utilities/copy.hpp"
// Thread-Local Edens support
@@ -48,7 +49,7 @@
void ThreadLocalAllocBuffer::accumulate_statistics_before_gc() {
global_stats()->initialize();
- for (JavaThread *thread = Threads::first(); thread != NULL; thread = thread->next()) {
+ for (JavaThreadIteratorWithHandle jtiwh; JavaThread *thread = jtiwh.next(); ) {
thread->tlab().accumulate_statistics();
thread->tlab().initialize_statistics();
}
@@ -130,7 +131,7 @@
void ThreadLocalAllocBuffer::resize_all_tlabs() {
if (ResizeTLAB) {
- for (JavaThread *thread = Threads::first(); thread != NULL; thread = thread->next()) {
+ for (JavaThreadIteratorWithHandle jtiwh; JavaThread *thread = jtiwh.next(); ) {
thread->tlab().resize();
}
}