curator-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From randg...@apache.org
Subject [6/7] git commit: CURATOR-110 - Fixed up the connection notifications so that they will only notify blocked clients when a connected state is reached, rather than any state.
Date Mon, 16 Jun 2014 17:40:57 GMT
CURATOR-110 - Fixed up the connection notifications so that they will
only notify blocked clients when a connected state is reached, rather
than any state.

Project: http://git-wip-us.apache.org/repos/asf/curator/repo
Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/59bab738
Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/59bab738
Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/59bab738

Branch: refs/heads/CURATOR-110
Commit: 59bab738f56e3e5017bcba8984c1d8ca24e1e71a
Parents: e8138ed
Author: Cameron McKenzie <mckenzie.cam@gmail.com>
Authored: Mon Jun 16 16:45:17 2014 +1000
Committer: Cameron McKenzie <mckenzie.cam@gmail.com>
Committed: Mon Jun 16 16:45:17 2014 +1000

----------------------------------------------------------------------
 .../apache/curator/framework/imps/CuratorFrameworkImpl.java   | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/curator/blob/59bab738/curator-framework/src/main/java/org/apache/curator/framework/imps/CuratorFrameworkImpl.java
----------------------------------------------------------------------
diff --git a/curator-framework/src/main/java/org/apache/curator/framework/imps/CuratorFrameworkImpl.java
b/curator-framework/src/main/java/org/apache/curator/framework/imps/CuratorFrameworkImpl.java
index d1de29f..14473d8 100644
--- a/curator-framework/src/main/java/org/apache/curator/framework/imps/CuratorFrameworkImpl.java
+++ b/curator-framework/src/main/java/org/apache/curator/framework/imps/CuratorFrameworkImpl.java
@@ -173,9 +173,12 @@ public class CuratorFrameworkImpl implements CuratorFramework
 			@Override
 			public void stateChanged(CuratorFramework client, ConnectionState newState)
 			{
-				synchronized(connectionLock)
+				if(newState.isConnected())
 				{
-					connectionLock.notifyAll();
+					synchronized(connectionLock)
+					{
+						connectionLock.notifyAll();
+					}
 				}
 			}
 		});


Mime
View raw message