From 57ed698463cbd3d52de64281c7f0c79777892c75 Mon Sep 17 00:00:00 2001 From: TudbuT Date: Wed, 27 Apr 2022 02:47:44 +0200 Subject: [PATCH] more mt fixes --- bootstrap/ISBPL.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bootstrap/ISBPL.java b/bootstrap/ISBPL.java index bb4b71a..fdb68ed 100644 --- a/bootstrap/ISBPL.java +++ b/bootstrap/ISBPL.java @@ -2133,14 +2133,14 @@ class ISBPLThreadLocal { 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); } }