문서의 선택한 두 판 사이의 차이를 보여줍니다.
| 다음 판 | 이전 판 | ||
|
java:threadlocal [2016/02/27 22:04] kwon37xi 만듦 |
java:threadlocal [2024/12/11 20:05] (현재) kwon37xi [Java ThreadLocal] |
||
|---|---|---|---|
| 줄 1: | 줄 1: | ||
| ====== Java ThreadLocal ====== | ====== Java ThreadLocal ====== | ||
| - | * [[http:// | + | * [[https:// |
| + | |||
| + | Each thread holds an implicit reference to its copy of a thread-local variable | ||
| + | as long as the thread is alive and the ThreadLocal instance is accessible; | ||
| + | after a thread goes away, all of its copies of thread-local instances are subject | ||
| + | to garbage collection (unless other references to these copies exist). | ||
| + | |||
| + | ===== withInitialValue ===== | ||
| + | * 초기값을 생성하는 lambda 를 지정해두면 최초에 값이 없을 때에 적절한 초기값을 제공해준다. | ||
| + | * '' | ||
| - | Each thread holds an implicit reference to its copy of a thread-local variable as long as the thread is alive and the ThreadLocal instance is accessible; after a thread goes away, all of its copies of thread-local instances are subject to garbage collection (unless other references to these copies exist). | ||
| ===== 참조 ===== | ===== 참조 ===== | ||