Skip to content

Commit

Permalink
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -67,6 +67,8 @@ public boolean visit(DynamicObject object) throws StopVisitingObjectsException {
}

private void visitRoots(final ObjectGraphVisitor visitor) {
final Thread mainThread = Thread.currentThread();

context.getSafepointManager().pauseAllThreadsAndExecute(null, false, new SafepointAction() {

boolean keepVisiting = true;
@@ -81,7 +83,7 @@ public void run(DynamicObject thread, Node currentNode) {
try {
// We only visit the global variables and other global state from the root thread

if (thread == context.getThreadManager().getRootThread()) {
if (Thread.currentThread() == mainThread) {
visitObject(context.getCoreLibrary().getGlobalVariablesObject(), visitor);

for (DynamicObject handler : context.getAtExitManager().getHandlers()) {

0 comments on commit 35aa81a

Please sign in to comment.