APIdia Launch Partner
Top Description Fields Constructors Methods
jdk.internal.misc

public Class CarrierThreadLocal<T>

extends ThreadLocal<T>
Class Inheritance
Known Direct Subclasses
jdk.internal.misc.TerminatingThreadLocal
Imports
jdk.internal.access.JavaLangAccess, .SharedSecrets

A ThreadLocal variant which binds its value to current thread's carrier thread.

Field Summary

Modifier and TypeField and Description
private static final JavaLangAccess

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public T
get()

Overrides java.lang.ThreadLocal.get.

Returns the value in the current thread's copy of this thread-local variable.

public void
remove()

Overrides java.lang.ThreadLocal.remove.

Removes the current thread's value for this thread-local variable.

public void
set(T value)

Overrides java.lang.ThreadLocal.set.

Sets the current thread's copy of this thread-local variable to the specified value.

Inherited from java.lang.ThreadLocal:
initialValuewithInitial

Field Detail

JLAback to summary
private static final JavaLangAccess JLA

Constructor Detail

CarrierThreadLocalback to summary
public CarrierThreadLocal()

Method Detail

getback to summary
public T get()

Overrides java.lang.ThreadLocal.get.

Doc from java.lang.ThreadLocal.get.

Returns the value in the current thread's copy of this thread-local variable. If the variable has no value for the current thread, it is first initialized to the value returned by an invocation of the initialValue method.

Annotations
@Override
removeback to summary
public void remove()

Overrides java.lang.ThreadLocal.remove.

Doc from java.lang.ThreadLocal.remove.

Removes the current thread's value for this thread-local variable. If this thread-local variable is subsequently read by the current thread, its value will be reinitialized by invoking its initialValue method, unless its value is set by the current thread in the interim. This may result in multiple invocations of the initialValue method in the current thread.

Annotations
@Override
setback to summary
public void set(T value)

Overrides java.lang.ThreadLocal.set.

Doc from java.lang.ThreadLocal.set.

Sets the current thread's copy of this thread-local variable to the specified value. Most subclasses will have no need to override this method, relying solely on the initialValue method to set the values of thread-locals.

Annotations
@Override