Specity thread to threadlocal
I am setting a value in a threadlocal variable "id" in the class "MyThreadLocal" in the thread "main".
A class is being executed in a different thread "sub".
It want to access the value of the variable "id" in thread "main". But I can't figure out how to specify the thread to the method get() within the threadlocal variable "id" of class "MythreadLocal". The specs say the get() uses the current thread.
My intent was to have global variables that could be used by any class in a process. Threadlocal works fine if the process is single threaded but if the process is multi-threaded Threadlocal doesn't seem to work. Does anyone know how to have global values through-out a process?