diff --git a/src/compile.cpp b/src/compile.cpp index 052df86620..e81323a2b0 100644 --- a/src/compile.cpp +++ b/src/compile.cpp @@ -2981,7 +2981,9 @@ gcIfNecessary(MyThread* t) void idleIfNecessary(MyThread* t) { - ENTER(t, Thread::IdleState); + if (UNLIKELY(t->m->exclusive)) { + ENTER(t, Thread::IdleState); + } } unsigned diff --git a/src/interpret.cpp b/src/interpret.cpp index cf8e296e49..46c3fcfaed 100644 --- a/src/interpret.cpp +++ b/src/interpret.cpp @@ -768,7 +768,9 @@ pushField(Thread* t, object target, object field) } void safePoint(Thread* t) { - ENTER(t, Thread::IdleState); + if (UNLIKELY(t->m->exclusive)) { + ENTER(t, Thread::IdleState); + } } object