GP-0: Fix timing issue in emulator service and p-code stepper test.

This commit is contained in:
Dan
2022-03-02 11:15:04 -05:00
parent 2d09b7513d
commit b1ca07ded5
2 changed files with 14 additions and 9 deletions
@@ -135,7 +135,10 @@ public abstract class AnnotatedSleighUseropLibrary<T> implements SleighUseropLib
Class<T> opType = getOperandType();
@SuppressWarnings({ "unchecked", "rawtypes" })
Class<? extends AnnotatedSleighUseropLibrary<T>> cls = (Class) this.getClass();
Set<Method> methods = CACHE_BY_CLASS.computeIfAbsent(cls, __ -> collectDefinitions(cls));
Set<Method> methods;
synchronized (CACHE_BY_CLASS) {
methods = CACHE_BY_CLASS.computeIfAbsent(cls, __ -> collectDefinitions(cls));
}
for (Method m : methods) {
ops.put(m.getName(), new AnnotatedSleighUseropDefinition<>(this, opType, lookup, m));
}