ozeigermann 2004/10/31 03:30:27
Modified: transaction/src/java/org/apache/commons/transaction/locking
GenericLock.java
Log:
Bug fix: combined mode was not checked
Revision Changes Path
1.8 +14 -5
jakarta-commons-sandbox/transaction/src/java/org/apache/commons/transaction/locking/GenericLock.java
Index: GenericLock.java
===================================================================
RCS file:
/home/cvs/jakarta-commons-sandbox/transaction/src/java/org/apache/commons/transaction/locking/GenericLock.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- GenericLock.java 31 Oct 2004 10:12:40 -0000 1.7
+++ GenericLock.java 31 Oct 2004 11:30:27 -0000 1.8
@@ -387,13 +387,22 @@
// we already have it
return true;
} else {
- // our own lock will not be compromised by ourself's
+ // our own lock will not be compromised by ourself
highestOwner = getMaxLevelOwner(myLock);
}
} else if (compatibility == COMPATIBILITY_SUPPORT) {
// we are compatible with any other lock owner holding
// the same lock level
highestOwner = getMaxLevelOwner(targetLockLevel);
+
+ } else if (compatibility == COMPATIBILITY_REENTRANT_AND_SUPPORT) {
+ if (myLock != null && targetLockLevel <= myLock.lockLevel) {
+ // we already have it
+ return true;
+ } else {
+ // our own lock will not be compromised by ourself and same lock
level
+ highestOwner = getMaxLevelOwner(myLock, targetLockLevel);
+ }
} else {
highestOwner = getMaxLevelOwner();
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]