more mt fixes
This commit is contained in:
parent
d2d7abaaaa
commit
57ed698463
1 changed files with 2 additions and 2 deletions
|
@ -2133,14 +2133,14 @@ class ISBPLThreadLocal<T> {
|
|||
return new ISBPLThreadLocal<>(supplier);
|
||||
}
|
||||
|
||||
public T get() {
|
||||
public synchronized T get() {
|
||||
long tid = Thread.currentThread().getId();
|
||||
if(!map.containsKey(tid))
|
||||
map.put(tid, supplier.get());
|
||||
return map.get(tid);
|
||||
}
|
||||
|
||||
public void set(T t) {
|
||||
public synchronized void set(T t) {
|
||||
map.put(Thread.currentThread().getId(), t);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue