作者:咖啡色的午后_905 | 来源:互联网 | 2024-10-22 17:31
譬如下列类,12345class ThreadLocalVar { static ThreadLocal clientId = new ThreadLocal() static ThreadLoc
譬如下列类,
1 2 3 4 5
| class ThreadLocalVar {
static ThreadLocal clientId = new ThreadLocal<>()
static ThreadLocal source = new ThreadLocal<>()
...
} |
有好几个ThreadLocal,只想部分用到的时候才初始化,怎么办?