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 Sun, 09 Jan 2005 19:33:53 GMT
ozeigermann    2005/01/09 11:33:53

  Modified:    transaction/src/java/org/apache/commons/transaction/locking
                        GenericLockManager.java
  Log:
  Constantly have owner registered as waiter while trying to acquire lock
  
  Revision  Changes    Path
  1.19      +13 -7     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.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- GenericLockManager.java	9 Jan 2005 19:10:10 -0000	1.18
  +++ GenericLockManager.java	9 Jan 2005 19:33:53 -0000	1.19
  @@ -218,9 +218,15 @@
                   } else {
                       timeoutMSecs = waitEnd - now;
                   }
  -        
  -                acquired = lock.acquire(ownerId, targetLockLevel, true, compatibility,
  -                        preferred, timeoutMSecs);
  +
  +                // XXX acquire will remove us as a waiter, but it is important to remain
us such
  +                // to constantly indicate it to other owners, otherwise there might be
undetected
  +                // deadlocks
  +                synchronized (lock) {
  +                    acquired = lock.acquire(ownerId, targetLockLevel, true, compatibility,
  +                            preferred, timeoutMSecs);
  +                    lock.registerWaiter(lockWaiter);
  +                }
                   
               }
               if (!acquired) {
  
  
  

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