Add synchronized on lockLeakCheck() because threadCountMap is not thread safe. (#6029)

Co-authored-by: lgh <liuguanghua@kanzhun.com>
This commit is contained in:
LiuGuH 2024-01-03 21:12:38 +08:00 committed by GitHub
parent e3c135b0b3
commit 335587df9e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -256,7 +256,7 @@ private synchronized void putThreadName(String thread) {
threadCountMap.putIfAbsent(thread, new TrackLog(thread));
}
public void lockLeakCheck() {
public synchronized void lockLeakCheck() {
if (!openLockTrace) {
LOG.warn("not open lock leak check func");
return;