Skip to content

Commit 82a0b09

Browse files
committed
Make HostedMethod.create thread-safe
1 parent 39a82fb commit 82a0b09

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

substratevm/src/com.oracle.svm.hosted/src/com/oracle/svm/hosted/meta/HostedUniverse.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
import java.util.List;
3434
import java.util.Map;
3535
import java.util.Optional;
36+
import java.util.concurrent.ConcurrentHashMap;
3637

3738
import org.graalvm.compiler.api.replacements.SnippetReflectionProvider;
3839
import org.graalvm.compiler.nodes.StructuredGraph;
@@ -293,7 +294,7 @@ public class HostedUniverse implements Universe {
293294
protected List<HostedField> orderedFields;
294295
protected List<HostedMethod> orderedMethods;
295296

296-
Map<String, Integer> uniqueHostedMethodNames = new HashMap<>();
297+
Map<String, Integer> uniqueHostedMethodNames = new ConcurrentHashMap<>();
297298

298299
public HostedUniverse(Inflation bb) {
299300
this.bb = bb;

0 commit comments

Comments
 (0)