[jboss-cvs] JBossCache/src/org/jboss/cache/interceptors ...
Manik Surtani
manik at jboss.org
Mon Jul 30 07:16:19 EDT 2007
User: msurtani
Date: 07/07/30 07:16:19
Modified: src/org/jboss/cache/interceptors Tag:
Branch_JBossCache_1_4_0
PessimisticLockInterceptor.java
Log:
JBCACHE-1157
Revision Changes Path
No revision
No revision
1.20.2.13 +4 -4 JBossCache/src/org/jboss/cache/interceptors/PessimisticLockInterceptor.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: PessimisticLockInterceptor.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/src/org/jboss/cache/interceptors/PessimisticLockInterceptor.java,v
retrieving revision 1.20.2.12
retrieving revision 1.20.2.13
diff -u -b -r1.20.2.12 -r1.20.2.13
--- PessimisticLockInterceptor.java 30 Jul 2007 11:12:47 -0000 1.20.2.12
+++ PessimisticLockInterceptor.java 30 Jul 2007 11:16:19 -0000 1.20.2.13
@@ -36,7 +36,7 @@
* current method and unlock when the method returns.
*
* @author Bela Ban
- * @version $Id: PessimisticLockInterceptor.java,v 1.20.2.12 2007/07/30 11:12:47 msurtani Exp $
+ * @version $Id: PessimisticLockInterceptor.java,v 1.20.2.13 2007/07/30 11:16:19 msurtani Exp $
*/
public class PessimisticLockInterceptor extends Interceptor
{
@@ -357,7 +357,7 @@
n.unmarkForRemoval(false);
}
- private boolean writeLockNeeded(int lock_type, int currentNodeIndex, int treeNodeSize, boolean isRemoveOperation, boolean createIfNotExists, boolean isRemoveDataOperation, Fqn targetFqn, Fqn currentFqn)
+ private boolean writeLockNeeded(int lock_type, int currentNodeIndex, int treeNodeSize, boolean isRemoveOperation, boolean isPutOperation, boolean isRemoveDataOperation, Fqn targetFqn, Fqn currentFqn)
{
if (writeLockOnChildInsertRemove)
{
@@ -365,10 +365,10 @@
return true; // we're doing a remove and we've reached the PARENT node of the target to be removed.
if (!isTargetNode(currentNodeIndex, treeNodeSize) && !cache.exists(new Fqn(currentFqn, targetFqn.get(currentNodeIndex + 1))))
- return createIfNotExists; // we're at a node in the tree, not yet at the target node, and we need to create the next node. So we need a WL here.
+ return isPutOperation; // we're at a node in the tree, not yet at the target node, and we need to create the next node. So we need a WL here.
}
- return lock_type == DataNode.LOCK_TYPE_WRITE && isTargetNode(currentNodeIndex, treeNodeSize) && (createIfNotExists || isRemoveOperation || isRemoveDataOperation); //normal operation, write lock explicitly requested and this is the target to be written to.
+ return lock_type == DataNode.LOCK_TYPE_WRITE && isTargetNode(currentNodeIndex, treeNodeSize) && (isPutOperation || isRemoveOperation || isRemoveDataOperation); //normal operation, write lock explicitly requested and this is the target to be written to.
}
private boolean isTargetNode(int nodePosition, int treeNodeSize)
More information about the jboss-cvs-commits
mailing list