use of com.oracle.truffle.polyglot.PolyglotContextImpl.ContextWeakReference in project graal by oracle.
the class PolyglotEngineImpl method getOrCreateEngineLoggers.
Object getOrCreateEngineLoggers() {
Object res = engineLoggers;
if (res == null) {
synchronized (this.lock) {
res = engineLoggers;
if (res == null) {
LoggerCache loggerCache = PolyglotLoggers.LoggerCache.newEngineLoggerCache(this);
loggerCache.setOwner(this);
res = LANGUAGE.createEngineLoggers(loggerCache);
if (!logLevels.isEmpty()) {
EngineAccessor.LANGUAGE.configureLoggers(this, logLevels, res);
}
for (ContextWeakReference contextRef : contexts) {
PolyglotContextImpl context = contextRef.get();
if (context != null && !context.config.logLevels.isEmpty()) {
LANGUAGE.configureLoggers(context, context.config.logLevels, res);
}
}
engineLoggers = res;
}
}
}
return res;
}
use of com.oracle.truffle.polyglot.PolyglotContextImpl.ContextWeakReference in project graal by oracle.
the class PolyglotEngineImpl method workContextReferenceQueue.
private void workContextReferenceQueue() {
Reference<?> ref;
while ((ref = contextsReferenceQueue.poll()) != null) {
ContextWeakReference contextRef = (ContextWeakReference) ref;
if (!contextRef.removed) {
contextRef.freeSharing(null);
contexts.remove(contextRef);
contextRef.removed = true;
}
}
}
Aggregations