Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 36c07fc

Browse files
Update when-and-how-should-i-use-a-threadlocal-variable.md
1 parent 94d6991 commit 36c07fc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎contents/when-and-how-should-i-use-a-threadlocal-variable.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## 该什么使用 ThreadLocal变量,它是如何工作的?
1+
## 该什么时候使用 ThreadLocal变量,它是如何工作的?
22
### 回答1
33
一种可能的(也是常见的)使用情形是你不想通过同步方式(synchronized)访问非线程安全的对象(说的就是SimpleDateFormat),而是想给每个线程一个对象实例的时候。
44
例如

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /