From 23bf87bef6a9fde138353f9cca271b2813ba6b01 Mon Sep 17 00:00:00 2001 From: chicc999 <123695646@qq.com> Date: Thu, 21 May 2020 16:58:35 +0800 Subject: [PATCH] fix issue #705 (#706) --- .../org/apache/rocketmq/store/ha/WaitNotifyObject.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/store/src/main/java/org/apache/rocketmq/store/ha/WaitNotifyObject.java b/store/src/main/java/org/apache/rocketmq/store/ha/WaitNotifyObject.java index 3483c992..75b7597f 100644 --- a/store/src/main/java/org/apache/rocketmq/store/ha/WaitNotifyObject.java +++ b/store/src/main/java/org/apache/rocketmq/store/ha/WaitNotifyObject.java @@ -21,6 +21,7 @@ import org.apache.rocketmq.logging.InternalLogger; import org.apache.rocketmq.logging.InternalLoggerFactory; import java.util.HashMap; +import java.util.Map; public class WaitNotifyObject { private static final InternalLogger log = InternalLoggerFactory.getLogger(LoggerName.STORE_LOGGER_NAME); @@ -65,9 +66,9 @@ public class WaitNotifyObject { synchronized (this) { boolean needNotify = false; - for (Boolean value : this.waitingThreadTable.values()) { - needNotify = needNotify || !value; - value = true; + for (Map.Entry entry : this.waitingThreadTable.entrySet()) { + needNotify = needNotify || !entry.getValue(); + entry.setValue(true); } if (needNotify) { -- GitLab