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/transaction/src/java/org/apache/commons/transaction/locking GenericLockManager.java
Date Thu, 16 Dec 2004 23:26:31 GMT
ozeigermann    2004/12/16 15:26:31

  Modified:    transaction/src/java/org/apache/commons/transaction/locking
                        GenericLockManager.java
  Log:
  Removed deadlock hazard from releaseAll that did not allow other owner threads
  to release their locks concurrently.
  
  Removed globalOwners synchronisation
 which caused this and had no benefit.
  
  Revision  Changes    Path
  1.4       +10 -12    jakarta-commons/transaction/src/java/org/apache/commons/transaction/locking/GenericLockManager.java
  
  Index: GenericLockManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/transaction/src/java/org/apache/commons/transaction/locking/GenericLockManager.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- GenericLockManager.java	14 Dec 2004 15:23:10 -0000	1.3
  +++ GenericLockManager.java	16 Dec 2004 23:26:31 -0000	1.4
  @@ -180,14 +180,12 @@
        * @see LockManager#releaseAll(Object)
        */
       public void releaseAll(Object ownerId) {
  -        synchronized (globalOwners) {
  -            Set locks = (Set) globalOwners.get(ownerId);
  -            if (locks != null) {
  -                for (Iterator it = locks.iterator(); it.hasNext();) {
  -                    GenericLock lock = (GenericLock) it.next();
  -                    lock.release(ownerId);
  -                    it.remove();
  -                }
  +        Set locks = (Set) globalOwners.get(ownerId);
  +        if (locks != null) {
  +            for (Iterator it = locks.iterator(); it.hasNext();) {
  +                GenericLock lock = (GenericLock) it.next();
  +                lock.release(ownerId);
  +                it.remove();
               }
           }
       }
  
  
  

---------------------------------------------------------------------
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