[jboss-cvs] JBossCache/src/org/jboss/cache/lock ...
Manik Surtani
manik at jboss.org
Tue Jun 19 11:41:34 EDT 2007
User: msurtani
Date: 07/06/19 11:41:34
Modified: src/org/jboss/cache/lock StripedLock.java
Log:
thread safety across JE transactions
Revision Changes Path
1.4 +24 -0 JBossCache/src/org/jboss/cache/lock/StripedLock.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: StripedLock.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/lock/StripedLock.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- StripedLock.java 19 Jun 2007 14:27:48 -0000 1.3
+++ StripedLock.java 19 Jun 2007 15:41:34 -0000 1.4
@@ -3,6 +3,7 @@
import net.jcip.annotations.ThreadSafe;
import org.jboss.cache.Fqn;
+import java.util.List;
import java.util.concurrent.locks.ReentrantReadWriteLock;
/**
@@ -115,4 +116,27 @@
h ^= (h >>> 10);
return h;
}
+
+ /**
+ * Releases locks on all fqns passed in. Makes multiple calls to {@link #releaseLock(org.jboss.cache.Fqn)}
+ *
+ * @param fqns list of fqns
+ * @see #releaseLock(org.jboss.cache.Fqn)
+ */
+ public void releaseAllLocks(List<Fqn> fqns)
+ {
+ for (Fqn f : fqns) releaseLock(f);
+ }
+
+ /**
+ * Acquires locks on all fqns passed in. Makes multiple calls to {@link #acquireLock(org.jboss.cache.Fqn,boolean)}
+ *
+ * @param fqns list of fqns
+ * @param exclusive whether locks are exclusive.
+ * @see #acquireLock(org.jboss.cache.Fqn,boolean)
+ */
+ public void acquireAllLocks(List<Fqn> fqns, boolean exclusive)
+ {
+ for (Fqn f : fqns) acquireLock(f, exclusive);
+ }
}
More information about the jboss-cvs-commits
mailing list