From 2110d5389beff3a81fb618050393bd8a070a75b8 Mon Sep 17 00:00:00 2001 From: walter Date: Thu, 24 Oct 2024 22:05:50 +0800 Subject: [PATCH] [improve](common) Add synchronized to avoid concurrent modification (#42384) --- .../java/org/apache/doris/common/MarkedCountDownLatch.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fe/fe-core/src/main/java/org/apache/doris/common/MarkedCountDownLatch.java b/fe/fe-core/src/main/java/org/apache/doris/common/MarkedCountDownLatch.java index ba407e7f3e1adc..14641d501d735d 100644 --- a/fe/fe-core/src/main/java/org/apache/doris/common/MarkedCountDownLatch.java +++ b/fe/fe-core/src/main/java/org/apache/doris/common/MarkedCountDownLatch.java @@ -35,7 +35,7 @@ public MarkedCountDownLatch(int count) { marks = HashMultimap.create(); } - public void addMark(K key, V value) { + public synchronized void addMark(K key, V value) { marks.put(key, value); } @@ -51,7 +51,7 @@ public synchronized List> getLeftMarks() { return Lists.newArrayList(marks.entries()); } - public Status getStatus() { + public synchronized Status getStatus() { return st; }