public abstract class ContextThreadLocal<T> extends Object
ContextThreadLocal.get() or less efficiently for other contexts and other threads using
ContextThreadLocal.get(TruffleContext, Thread). Context thread locals can be created for languages and
instruments. See links below for usage examples.Usage with languages.,
Usage with instruments.| Modifier | Constructor and Description |
|---|---|
protected |
ContextThreadLocal(Object polyglotObject)
Custom subclasses of context local are not allowed.
|
| Modifier and Type | Method and Description |
|---|---|
abstract T |
get()
Returns the context thread local value for the currently entered context and thread.
|
abstract T |
get(Thread t)
Returns the context thread local value for the currently entered context and the given
thread.
|
abstract T |
get(TruffleContext t)
Returns the context thread local value for the given context and the current thread.his
method is intended to be used on compiled code paths.
|
abstract T |
get(TruffleContext context,
Thread t)
Returns the context thread local value for the given context and the given thread.
|
protected ContextThreadLocal(Object polyglotObject)
public abstract T get()
null. Throws IllegalStateException if no current context is entered on
the current thread.public abstract T get(Thread t)
ContextThreadLocal.get() or ContextThreadLocal.get(TruffleContext) as
it requires synchronization between the threads. The return value is never null.
Throws IllegalStateException if no current context is entered on the current thread.public abstract T get(TruffleContext t)
null. Throws IllegalStateException if no current context is entered on
the current thread.public abstract T get(TruffleContext context, Thread t)
ContextThreadLocal.get() or ContextThreadLocal.get(TruffleContext) as it requires
synchronization between the threads. The return value is never null. Throws
IllegalStateException if no current context is entered on the current thread.