commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ozeigerm...@apache.org
Subject cvs commit: jakarta-commons-sandbox/transaction/src/java/org/apache/commons/transaction/locking GenericLock.java
Date Sun, 31 Oct 2004 11:30:27 GMT
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: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message