Skip to content

Commit 8a126d7

Browse files
committed
[GR-38990] Execution termination should start instrumentation before thread interruption.
PullRequest: js/2473
2 parents 0734181 + a7d3658 commit 8a126d7

File tree

1 file changed

+4
-4
lines changed
  • graal-nodejs/mx.graal-nodejs/com.oracle.truffle.trufflenode/src/com/oracle/truffle/trufflenode

1 file changed

+4
-4
lines changed

graal-nodejs/mx.graal-nodejs/com.oracle.truffle.trufflenode/src/com/oracle/truffle/trufflenode/GraalJSAccess.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3191,10 +3191,6 @@ public synchronized void isolateTerminateExecution() {
31913191
return; // termination in progress already
31923192
}
31933193
terminateExecution = true;
3194-
Thread thread = agent.getThread();
3195-
if (thread != null) {
3196-
thread.interrupt();
3197-
}
31983194
Debugger debugger = lookupInstrument("debugger", Debugger.class);
31993195
if (debugger == null) {
32003196
System.err.println("Debugger is not available!");
@@ -3209,6 +3205,10 @@ public synchronized void isolateTerminateExecution() {
32093205
}
32103206
throw new GraalJSKillException();
32113207
}).suspendNextExecution();
3208+
Thread thread = agent.getThread();
3209+
if (thread != null) {
3210+
thread.interrupt();
3211+
}
32123212
}
32133213

32143214
static final class GraalJSKillException extends ThreadDeath {

0 commit comments

Comments
 (0)