1. There is a variable in the Thread class that is Threadlocalmap type
2. This threadlocalmap is responsible for saving all the ThreadLocal variables we create.
3. Then, we do not need to pay attention to how the ThreadLocal variable is associated with Thread, direct Get/set OK
Threadlocalmap is the container of many ThreadLocal variables that we create, and this container is a member of a thread that is monopolized
The Key in Threadlocalmap is the reference to the ThreadLocal variable we created.
So when calling Tl1.set or Tl1.get, you can find yourself in the MAP according to the TL1 reference, reading or updating your own values
And Threadlocalmap is a member variable of a thread, so get the current thread first when getting threadlocalmap,
Then read its THREADLOCALMAP member (variable name threadlocals)
The ThreadLocal type of variable, which is equivalent to supporting the operation of the Threadlocalmap internally, saves us from placing the variable in the map, directly to a set itself and putting itself into the map.
In fact, if Threadlocalmap open operation interface, we can define ordinary variable (not ThreadLocal type),
Manually put in the Threadlocalmap, the effect should be similar,
In short, the ThreadLocal type of variable is inherently supporting operations Threadlocalmap