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/test/org/apache/commons/transaction/locking GenericLockTest.java
Date Wed, 15 Dec 2004 17:36:35 GMT
ozeigermann    2004/12/15 09:36:35

  Modified:    transaction/src/test/org/apache/commons/transaction/locking
                        GenericLockTest.java
  Log:
  Added restart synchronizer to assure a full test run has been completed
  before starting a new one
  
  Revision  Changes    Path
  1.3       +17 -4     jakarta-commons/transaction/src/test/org/apache/commons/transaction/locking/GenericLockTest.java
  
  Index: GenericLockTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons/transaction/src/test/org/apache/commons/transaction/locking/GenericLockTest.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- GenericLockTest.java	14 Dec 2004 12:12:47 -0000	1.2
  +++ GenericLockTest.java	15 Dec 2004 17:36:35 -0000	1.3
  @@ -153,6 +153,9 @@
   
           // a read / write lock
           final ReadWriteLockManager manager = new ReadWriteLockManager(sLogger, TIMEOUT);
  +        
  +        final RendezvousBarrier restart = new RendezvousBarrier("restart",
  +                TIMEOUT, sLogger);
   
           for (int i = 0; i < 25; i++) {
   
  @@ -177,6 +180,12 @@
                       } catch (InterruptedException ie) {
                       } finally {
                           manager.releaseAll(owner2);
  +                        try {
  +                            synchronized (restart) {
  +                                restart.meet();
  +                                restart.reset();
  +                            }
  +                            } catch (InterruptedException ie) {}
                       }
                   }
               }, "Deadlock Thread");
  @@ -198,6 +207,10 @@
                   deadlockCnt++;
               } finally {
                   manager.releaseAll(owner1);
  +                synchronized (restart) {
  +                    restart.meet();
  +                    restart.reset();
  +                }
               }
   
               assertEquals(deadlockCnt, 1);
  
  
  

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