You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@curator.apache.org by dr...@apache.org on 2017/05/02 20:06:15 UTC
[07/50] curator git commit: Merge branch 'master' into CURATOR-3.0
Merge branch 'master' into CURATOR-3.0
Project: http://git-wip-us.apache.org/repos/asf/curator/repo
Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/da48ef38
Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/da48ef38
Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/da48ef38
Branch: refs/heads/master
Commit: da48ef388f6153e66d251121854bb0faae77a3ec
Parents: e683264 d3bccce
Author: randgalt <ra...@apache.org>
Authored: Sun Jan 8 00:43:32 2017 -0500
Committer: randgalt <ra...@apache.org>
Committed: Sun Jan 8 00:43:32 2017 -0500
----------------------------------------------------------------------
.../framework/recipes/cache/TreeCache.java | 67 ++++++++++++--------
.../locks/InterProcessSemaphoreMutex.java | 13 ++--
2 files changed, 43 insertions(+), 37 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/curator/blob/da48ef38/curator-recipes/src/main/java/org/apache/curator/framework/recipes/cache/TreeCache.java
----------------------------------------------------------------------
diff --cc curator-recipes/src/main/java/org/apache/curator/framework/recipes/cache/TreeCache.java
index ed32223,3ffb58f..9bf2789
--- a/curator-recipes/src/main/java/org/apache/curator/framework/recipes/cache/TreeCache.java
+++ b/curator-recipes/src/main/java/org/apache/curator/framework/recipes/cache/TreeCache.java
@@@ -286,8 -290,9 +297,8 @@@ public class TreeCache implements Close
void wasDeleted() throws Exception
{
- ChildData oldChildData = childData.getAndSet(null);
- ConcurrentMap<String, TreeNode> childMap = children.getAndSet(null);
+ ChildData oldChildData = childDataUpdater.getAndSet(this, null);
- client.clearWatcherReferences(this);
+ ConcurrentMap<String, TreeNode> childMap = childrenUpdater.getAndSet(this,null);
if ( childMap != null )
{
ArrayList<TreeNode> childCopy = new ArrayList<TreeNode>(childMap.values());
http://git-wip-us.apache.org/repos/asf/curator/blob/da48ef38/curator-recipes/src/main/java/org/apache/curator/framework/recipes/locks/InterProcessSemaphoreMutex.java
----------------------------------------------------------------------
diff --cc curator-recipes/src/main/java/org/apache/curator/framework/recipes/locks/InterProcessSemaphoreMutex.java
index 444b10d,ba3b649..57e2c80
--- a/curator-recipes/src/main/java/org/apache/curator/framework/recipes/locks/InterProcessSemaphoreMutex.java
+++ b/curator-recipes/src/main/java/org/apache/curator/framework/recipes/locks/InterProcessSemaphoreMutex.java
@@@ -64,17 -61,10 +64,12 @@@ public class InterProcessSemaphoreMute
@Override
public void release() throws Exception
{
+ Lease lease = this.lease;
Preconditions.checkState(lease != null, "Not acquired");
+
- try
- {
- lease.close();
- watcherRemoveClient.removeWatchers();
- }
- finally
- {
- lease = null;
- }
+ this.lease = null;
+ lease.close();
++ watcherRemoveClient.removeWatchers();
}
@Override