--- old/src/hotspot/share/gc/shared/threadLocalAllocBuffer.cpp Sat Nov 18 16:55:02 2017 +++ new/src/hotspot/share/gc/shared/threadLocalAllocBuffer.cpp Sat Nov 18 16:55:01 2017 @@ -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(); } }