Package EDU.oswego.cs.dl.util.concurrent

Examples of EDU.oswego.cs.dl.util.concurrent.ReentrantWriterPreferenceReadWriteLock


     
      this.channelIDManager = channelIDManager;
     
      this.clusterNotifier = clusterNotifier;

      lock = new ReentrantWriterPreferenceReadWriteLock();
      
      waitForBindUnbindLock = new Object();
   }
View Full Code Here


        ReadWriteLock lock = (ReadWriteLock) mLocks.get(key);

        if (null == lock)
        {
            lock = new ReentrantWriterPreferenceReadWriteLock();

            mLocks.put(key, lock);
        }

        return lock;
View Full Code Here

     
      this.channelIDManager = channelIDManager;
     
      this.clusterNotifier = clusterNotifier;

      lock = new ReentrantWriterPreferenceReadWriteLock();
      
      waitForBindUnbindLock = new Object();
   }
View Full Code Here

     
      this.channelIDManager = channelIDManager;
     
      this.clusterNotifier = clusterNotifier;

      lock = new ReentrantWriterPreferenceReadWriteLock();
      
      waitForBindUnbindLock = new Object();
   }
View Full Code Here

     
      this.channelIDManager = channelIDManager;
     
      this.clusterNotifier = clusterNotifier;

      lock = new ReentrantWriterPreferenceReadWriteLock();
      
      waitForBindUnbindLock = new Object();
   }
View Full Code Here

         throw ex;
   }


   public void testMoreWriteReleasesThanAcquisitions() throws InterruptedException {
      lock=new ReentrantWriterPreferenceReadWriteLock();
      lock.writeLock().acquire();
      lock.writeLock().release();
      lock.writeLock().release();
   }
View Full Code Here

      lock.writeLock().release();
      lock.writeLock().release();
   }

   public void testMoreReadReleasesThanAcquisitions() throws InterruptedException {
      lock=new ReentrantWriterPreferenceReadWriteLock();
      lock.readLock().acquire();
      lock.readLock().release();
      try {
         lock.readLock().release();
         fail("read locks cannot be released more than acquired");
View Full Code Here

      }
   }

   public void testSimple() throws InterruptedException {
      lock=new ReentrantWriterPreferenceReadWriteLock();
      lock.readLock().acquire();
      lock.readLock().acquire();
      lock.writeLock().acquire();
      lock.writeLock().acquire();
   }
View Full Code Here

      lock.writeLock().acquire();
   }


   public void testOneWriterMultipleReaders() throws InterruptedException {
      lock=new ReentrantWriterPreferenceReadWriteLock();

      Writer writer=new Writer("writer");
      Reader reader1=new Reader("reader1");
      Reader reader2=new Reader("reader2");
View Full Code Here

      Map distribution = new HashMap();

      Iterator fqnsIterator = fqns.iterator();
      while (fqnsIterator.hasNext())
      {
         ReentrantWriterPreferenceReadWriteLock lock = stripedLock.getLock((Fqn) fqnsIterator.next());
         if (distribution.containsKey(lock))
         {
            int count = ((Integer) distribution.get(lock)).intValue() + 1;
            distribution.put(lock, new Integer(count));
         }
View Full Code Here

TOP

Related Classes of EDU.oswego.cs.dl.util.concurrent.ReentrantWriterPreferenceReadWriteLock

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.