Skip to content

Commit 703c7b4

Browse files
committed
Update java-concurrent-questions-02.md
1 parent 1841062 commit 703c7b4

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

docs/java/concurrent/java-concurrent-questions-02.md

+3
Original file line numberDiff line numberDiff line change
@@ -457,9 +457,12 @@ public class Thread implements Runnable {
457457

458458
```java
459459
public void set(T value) {
460+
//获取当前请求的线程
460461
Thread t = Thread.currentThread();
462+
//取出 Thread 类内部的 threadLocals 变量(哈希表结构)
461463
ThreadLocalMap map = getMap(t);
462464
if (map != null)
465+
// 将需要存储的值放入到这个哈希表中
463466
map.set(this, value);
464467
else
465468
createMap(t, value);

0 commit comments

Comments
 (0)