Alias for set(v: T)
Alias for set(v: T)
the value to set.
Returns a Box containing the value of this ThreadGlobal in a null-safe fashion.
Sets this ThreadGlobal's contents to the specified value, executes the specified function, and then restores the ThreadGlobal to its earlier value.
Sets this ThreadGlobal's contents to the specified value, executes the specified function, and then restores the ThreadGlobal to its earlier value. This effectively creates a scope within the execution of the current thread for the execution of the specified function.
the value to temporarily set in this ThreadGlobal
the function to execute
Sets the value of this ThreadGlobal.
Sets the value of this ThreadGlobal.
the value to set.
Returns the current value of this variable.
This is a decorator for a ThreadLocal variable that provides convenience methods to transform the variable to a Box and execute functions in a "scope" wherein the variable may hold a different value.