Skip to content

Commit 211ea12

Browse files
committed
delay entering truffle context for logging
1 parent 7ca690a commit 211ea12

File tree

1 file changed

+6
-3
lines changed
  • espresso/src/com.oracle.truffle.espresso.jdwp/src/com/oracle/truffle/espresso/jdwp/impl

1 file changed

+6
-3
lines changed

espresso/src/com.oracle.truffle.espresso.jdwp/src/com/oracle/truffle/espresso/jdwp/impl/JDWP.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1105,12 +1105,13 @@ public Object call() {
11051105
new Thread(new Runnable() {
11061106
@Override
11071107
public void run() {
1108-
boolean entered = controller.enterTruffleContext();
1108+
boolean entered = false;
11091109
CommandResult commandResult = new CommandResult(reply);
11101110
try {
11111111
ThreadJob<?>.JobResult<?> result = job.getResult();
11121112
writeMethodResult(reply, context, result);
11131113
} catch (Throwable t) {
1114+
entered = controller.enterTruffleContext();
11141115
reply.errorCode(ErrorCodes.INTERNAL);
11151116
// Checkstyle: stop allow error output
11161117
if (entered) {
@@ -1286,12 +1287,13 @@ public Object call() throws Exception {
12861287
new Thread(new Runnable() {
12871288
@Override
12881289
public void run() {
1289-
boolean entered = controller.enterTruffleContext();
1290+
boolean entered = false;
12901291
CommandResult commandResult = new CommandResult(reply);
12911292
try {
12921293
ThreadJob<?>.JobResult<?> result = job.getResult();
12931294
writeMethodResult(reply, context, result);
12941295
} catch (Throwable t) {
1296+
entered = controller.enterTruffleContext();
12951297
reply.errorCode(ErrorCodes.INTERNAL);
12961298
// Checkstyle: stop allow error output
12971299
if (entered) {
@@ -1783,12 +1785,13 @@ public Object call() throws Exception {
17831785
new Thread(new Runnable() {
17841786
@Override
17851787
public void run() {
1786-
boolean entered = controller.enterTruffleContext();
1788+
boolean entered = false;
17871789
CommandResult commandResult = new CommandResult(reply);
17881790
try {
17891791
ThreadJob<?>.JobResult<?> result = job.getResult();
17901792
writeMethodResult(reply, context, result);
17911793
} catch (Throwable t) {
1794+
entered = controller.enterTruffleContext();
17921795
reply.errorCode(ErrorCodes.INTERNAL);
17931796
// Checkstyle: stop allow error output
17941797
if (entered) {

0 commit comments

Comments
 (0)