Skip to content

Commit

Permalink
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions core/src/main/java/org/jruby/compiler/BlockJITTask.java
Original file line number Diff line number Diff line change
@@ -47,6 +47,9 @@ public BlockJITTask(JITCompiler jitCompiler, MixedModeIRBlockBody body, String c
}

public void run() {
// We synchronize against the JITCompiler object so at most one code body will jit at once in a given runtime.
// This works around unsolved concurrency issues within the process of preparing and jitting the IR.
// See #4739 for a reproduction script that produced various errors without this.
synchronized (jitCompiler) {
try {
String key = SexpMaker.sha1(body.getIRScope());
3 changes: 3 additions & 0 deletions core/src/main/java/org/jruby/compiler/MethodJITTask.java
Original file line number Diff line number Diff line change
@@ -53,6 +53,9 @@ public MethodJITTask(JITCompiler jitCompiler, MixedModeIRMethod method, String c
}

public void run() {
// We synchronize against the JITCompiler object so at most one code body will jit at once in a given runtime.
// This works around unsolved concurrency issues within the process of preparing and jitting the IR.
// See #4739 for a reproduction script that produced various errors without this.
synchronized (jitCompiler) {
try {
// Check if the method has been explicitly excluded

0 comments on commit a0892f6

Please sign in to comment.