more mt fixes

This commit is contained in:
Daniella 2022-04-27 02:47:44 +02:00
parent d2d7abaaaa
commit 57ed698463

View file

@ -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);
}
}