From 453e0ca541911775d307b50fa0e5215e6ee144be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B5=B5=E5=BB=B6?= <1060026287@qq.com> Date: Fri, 26 Mar 2021 15:41:30 +0800 Subject: [PATCH] makes latch volatile. (#7448) --- .../org/apache/dubbo/registry/zookeeper/ZookeeperRegistry.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dubbo-registry/dubbo-registry-zookeeper/src/main/java/org/apache/dubbo/registry/zookeeper/ZookeeperRegistry.java b/dubbo-registry/dubbo-registry-zookeeper/src/main/java/org/apache/dubbo/registry/zookeeper/ZookeeperRegistry.java index cb978929241..ddfb48a69f4 100644 --- a/dubbo-registry/dubbo-registry-zookeeper/src/main/java/org/apache/dubbo/registry/zookeeper/ZookeeperRegistry.java +++ b/dubbo-registry/dubbo-registry-zookeeper/src/main/java/org/apache/dubbo/registry/zookeeper/ZookeeperRegistry.java @@ -292,7 +292,7 @@ protected boolean isMatch(URL subscribeUrl, URL providerUrl) { private class RegistryChildListenerImpl implements ChildListener { private RegistryNotifier notifier; private long lastExecuteTime; - private CountDownLatch latch; + private volatile CountDownLatch latch; public RegistryChildListenerImpl(URL consumerUrl, String path, NotifyListener listener, CountDownLatch latch) { this.latch = latch;