The thread-local class also provides the remove() method that deletes the value stored in a thread-local variable for the thread that it's calling.
The Java Concurrency API includes the InheritableThreadLocal class that provides inheritance of values for threads created from a thread. If thread A has a value in a thread-local variable and it creates another thread B, then thread B will have the same value as thread A in the thread-local variable. You can override the childValue() method that is called to initialize the value of the child thread in the thread-local variable. It receives the value of the parent thread as a parameter in the thread-local variable.