Examples of ReentrantReadWriteLock


Examples of edu.emory.mathcs.backport.java.util.concurrent.locks.ReentrantReadWriteLock

        messageFactory_ = messageFactory;

        evaluationContextFactory_ = evaluationContextFactory;

        constraintsLock_ = new ReentrantReadWriteLock();

        wildcardMap_ = newWildcardMap(config);

        disposables_.addDisposable(callbackManager_);
View Full Code Here

Examples of java.util.concurrent.locks.ReentrantReadWriteLock

        super(capacity);
        locks = new Lock[capacity];
        for(int j = 0; j < locks.length; j++) {
            locks[j] = new ReentrantLock();
        }
        ReadWriteLock rwLock = new ReentrantReadWriteLock();
        readLock = rwLock.readLock();
        writeLock = rwLock.writeLock();
    }
View Full Code Here

Examples of java.util.concurrent.locks.ReentrantReadWriteLock

                + ", scanPercentage: " + percent + ", scanLength: " + scanLength + ", pageSize: "
                + pageSize);

        final Segments pager = makeTempSegments(pageSize);
        final Status[] stats = new Status[threads];
        final ReadWriteLock rwlock = new ReentrantReadWriteLock();

        final boolean isGCLOCK = (algo == ReplacementAlgorithm.GClock);

        _start = _stop = false;
        final Thread[] thrs = new Thread[threads];
View Full Code Here

Examples of java.util.concurrent.locks.ReentrantReadWriteLock

                + ", scanPercentage: " + percent + ", scanLength: " + scanLength + ", pageSize: "
                + pageSize);

        final Segments pager = makeTempSegments(pageSize);
        final Status[] stats = new Status[threads];
        final ReadWriteLock rwlock = new ReentrantReadWriteLock();

        final boolean isGCLOCK = (algo == ReplacementAlgorithm.GClock);

        _start = _stop = false;
        final Thread[] thrs = new Thread[threads];
View Full Code Here

Examples of java.util.concurrent.locks.ReentrantReadWriteLock

         throw ex;
   }

   public void testMoreWriteReleasesThanAcquisitions() throws InterruptedException
   {
      lock = new ReentrantReadWriteLock();
      lock.writeLock().lock();
      lock.writeLock().unlock();
      try
      {
         lock.writeLock().unlock();
View Full Code Here

Examples of java.util.concurrent.locks.ReentrantReadWriteLock

      }
   }

   public void testMoreReadReleasesThanAcquisitions() throws InterruptedException
   {
      lock = new ReentrantReadWriteLock();
      lock.readLock().lock();
      lock.readLock().unlock();
      try
      {
         lock.readLock().unlock();
View Full Code Here

Examples of java.util.concurrent.locks.ReentrantReadWriteLock

      }
   }

   public void testSimple() throws InterruptedException
   {
      lock = new ReentrantReadWriteLock();
      lock.readLock().lock();
      // upgrades must be manual; involving giving up the RL first.  Sucks.
      // see http://java.sun.com/j2se/1.5.0/docs/api/java/util/concurrent/locks/ReentrantReadWriteLock.html
      lock.readLock().unlock();
View Full Code Here

Examples of java.util.concurrent.locks.ReentrantReadWriteLock

      lock.writeLock().lock();
   }

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

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

Examples of java.util.concurrent.locks.ReentrantReadWriteLock

    private static ReadWriteLock accquireLock(final String key, final Map<String, ReadWriteLock> locks) {
        ReadWriteLock lock;
        synchronized(locks) {
            lock = locks.get(key);
            if(lock == null) {
                lock = new ReentrantReadWriteLock();
                locks.put(key, lock);
            }
        }
        lock.writeLock().lock();
        return lock;
View Full Code Here

Examples of java.util.concurrent.locks.ReentrantReadWriteLock

            singletonPool.setPoolConfiguration(poolConfig);
            setPool(new PoolWrapper<EasyBeansSingletonSB>(singletonPool));
        }

        // pool
        this.lock = new ReentrantReadWriteLock();
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.