Returns the value in the current thread's copy of this thread-local variable.
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 initialized with the initial value specified in the constructor.
the current thread's value of this thread-local
is the initial value that this thread-local reference returns on reads in case the current thread hasn't written any values yet.
Removes the current thread's value for this thread-local variable.
Sets the current thread's copy of this thread-local variable to the specified value.
Sets the current thread's copy of this thread-local variable to the specified value.
the value to be stored in the current thread's copy of this thread-local.
Cross-platform equivalent for
java.lang.ThreadLocal
, for specifying thread-local variables.These variables differ from their normal counterparts in that each thread that accesses one (via its ThreadLocal#get or ThreadLocal#set method) has its own, independently initialized copy of the variable.