Skip to content

Commit 50c252b

Browse files
committed
[GR-29304] [GR-30676] Do not check hasPendingSideEffectingActions() in runPendingSafepointActions()
* Notably for "after" it was incorrect since at that point we already restored the allowSideEffects value, and then it would always return false if prevSideEffects is true.
1 parent 64c3914 commit 50c252b

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

src/main/java/org/truffleruby/core/thread/ThreadNodes.java

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ protected Object handleInterrupt(RubyThread self, RubySymbol timing, RubyProc bl
341341
try {
342342
if (newInterruptMode == InterruptMode.IMMEDIATE) {
343343
beforeProfile.enter();
344-
runPendingSafepointActions(safepoint, "before");
344+
runPendingSafepointActions("before");
345345
}
346346

347347
return callBlock(block);
@@ -351,20 +351,17 @@ protected Object handleInterrupt(RubyThread self, RubySymbol timing, RubyProc bl
351351

352352
if (oldInterruptMode != InterruptMode.NEVER) {
353353
afterProfile.enter();
354-
runPendingSafepointActions(safepoint, "after");
354+
runPendingSafepointActions("after");
355355
}
356356
}
357357
}
358358

359359
@TruffleBoundary
360-
private void runPendingSafepointActions(TruffleSafepoint safepoint, String when) {
361-
if (safepoint.hasPendingSideEffectingActions()) {
362-
if (getContext().getOptions().LOG_PENDING_INTERRUPTS) {
363-
RubyLanguage.LOGGER
364-
.info("Running pending interrupts " + when + " Thread.handle_interrupt");
365-
}
366-
TruffleSafepoint.pollHere(this);
360+
private void runPendingSafepointActions(String when) {
361+
if (getContext().getOptions().LOG_PENDING_INTERRUPTS) {
362+
RubyLanguage.LOGGER.info("Running pending interrupts " + when + " Thread.handle_interrupt");
367363
}
364+
TruffleSafepoint.pollHere(this);
368365
}
369366

370367
private InterruptMode symbolToInterruptMode(RubyLanguage language, RubySymbol symbol) {

0 commit comments

Comments
 (0)