--- old/src/hotspot/share/prims/whitebox.cpp Wed Nov 8 09:06:08 2017 +++ new/src/hotspot/share/prims/whitebox.cpp Wed Nov 8 09:06:08 2017 @@ -54,6 +54,7 @@ #include "runtime/os.hpp" #include "runtime/sweeper.hpp" #include "runtime/thread.hpp" +#include "runtime/threadSMR.hpp" #include "runtime/vm_version.hpp" #include "utilities/align.hpp" #include "utilities/debug.hpp" @@ -660,7 +661,7 @@ int result() const { return _result; } void doit() { - for (JavaThread* t = Threads::first(); t != NULL; t = t->next()) { + for (JavaThreadIteratorWithHandle jtiwh; JavaThread *t = jtiwh.next(); ) { if (t->has_last_Java_frame()) { for (StackFrameStream fst(t, UseBiasedLocking); !fst.is_done(); fst.next()) { frame* f = fst.current();