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:30 UTC
[2/5] curator git commit: CURATOR-401: Make
InterProcessMutex.isOwnedByCurrentThread public
CURATOR-401: Make InterProcessMutex.isOwnedByCurrentThread public
Project: http://git-wip-us.apache.org/repos/asf/curator/repo
Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/96cb3374
Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/96cb3374
Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/96cb3374
Branch: refs/heads/CURATOR-3.0
Commit: 96cb3374f1170afd1b3a5f7ac0fe82d79636a093
Parents: 302661a
Author: Stig Rohde Døssing <st...@gmail.com>
Authored: Tue Apr 18 18:24:56 2017 +0200
Committer: Stig Rohde Døssing <st...@gmail.com>
Committed: Tue Apr 18 18:24:56 2017 +0200
----------------------------------------------------------------------
.../curator/framework/recipes/locks/InterProcessMutex.java | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/curator/blob/96cb3374/curator-recipes/src/main/java/org/apache/curator/framework/recipes/locks/InterProcessMutex.java
----------------------------------------------------------------------
diff --git a/curator-recipes/src/main/java/org/apache/curator/framework/recipes/locks/InterProcessMutex.java b/curator-recipes/src/main/java/org/apache/curator/framework/recipes/locks/InterProcessMutex.java
index e178f73..08b8ba1 100644
--- a/curator-recipes/src/main/java/org/apache/curator/framework/recipes/locks/InterProcessMutex.java
+++ b/curator-recipes/src/main/java/org/apache/curator/framework/recipes/locks/InterProcessMutex.java
@@ -195,7 +195,12 @@ public class InterProcessMutex implements InterProcessLock, Revocable<InterProce
internals = new LockInternals(client, driver, path, lockName, maxLeases);
}
- boolean isOwnedByCurrentThread()
+ /**
+ * Returns true if the mutex is acquired by the calling thread
+ *
+ * @return true/false
+ */
+ public boolean isOwnedByCurrentThread()
{
LockData lockData = threadData.get(Thread.currentThread());
return (lockData != null) && (lockData.lockCount.get() > 0);