Examples of readLock()


Examples of EDU.oswego.cs.dl.util.concurrent.ReadWriteLock.readLock()

    Sync rl, wl;

    protected void setUp() throws Exception {
        super.setUp();
        ReadWriteLock l=new ReentrantWriterPreferenceReadWriteLock();
        rl=l.readLock();
        wl=l.writeLock();
    }

    protected void tearDown() throws Exception {
        super.tearDown();
View Full Code Here

Examples of EDU.oswego.cs.dl.util.concurrent.ReentrantWriterPreferenceReadWriteLock.readLock()

    Sync rl, wl;

    protected void setUp() throws Exception {
        super.setUp();
        ReadWriteLock l=new ReentrantWriterPreferenceReadWriteLock();
        rl=l.readLock();
        wl=l.writeLock();
    }

    protected void tearDown() throws Exception {
        super.tearDown();
View Full Code Here

Examples of ca.odell.glazedlists.util.concurrent.ReadWriteLock.readLock()

        private final DebugLock writeLock;

        public DebugReadWriteLock() {
            // decorate normaly read/write locks with Thread recording
            final ReadWriteLock decorated = LockFactory.DEFAULT.createReadWriteLock();
            this.readLock = new DebugLock(decorated.readLock());
            this.writeLock = new DebugLock(decorated.writeLock());
        }

        public Lock readLock() { return readLock; }
        public Lock writeLock() { return writeLock; }
View Full Code Here

Examples of com.intellij.util.concurrency.JBReentrantReadWriteLock.readLock()

  private final JBLock r;
  private final JBLock w;

  protected FieldCache() {
    JBReentrantReadWriteLock ourLock = LockFactory.createReadWriteLock();
    r = ourLock.readLock();
    w = ourLock.writeLock();
  }

  public T get(AccessorParameter a, Owner owner, Parameter p) {
    r.lock();
View Full Code Here

Examples of com.netflix.curator.framework.recipes.locks.InterProcessReadWriteLock.readLock()

   
    //Acquire/release the read/write lock based on parameters
    try{
      if(type == 'R'){
        if(op == 'A'){
          lock.readLock().acquire();
        }else{
          lock.readLock().release();
        }
      }else{
        if(op == 'A'){
View Full Code Here

Examples of java.util.concurrent.locks.ReadWriteLock.readLock()

        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();
    }

    /**
     * double the set size
View Full Code Here

Examples of java.util.concurrent.locks.ReadWriteLock.readLock()

        final List<Pair<String, Lock>> localExecResources = new ArrayList<Pair<String, Lock>>(_relativePaths.size());

        int totalLocked = 0;
        for(String path : _relativePaths) {
            ReadWriteLock lock = lockManager.obtainLock(path);
            final Lock rlock = lock.readLock();
            if(rlock.tryLock()) {
                localExecResources.add(new Pair<String, Lock>(path, rlock));
            } else {
                totalLocked++;
                final byte[] k = StringUtils.getBytes(path);
View Full Code Here

Examples of java.util.concurrent.locks.ReadWriteLock.readLock()

        final List<Pair<String, Lock>> localExecResources = new ArrayList<Pair<String, Lock>>(relativePaths.size());

        int totalLocked = 0;
        for(String path : relativePaths) {
            ReadWriteLock lock = lockManager.obtainLock(path);
            final Lock rlock = lock.readLock();
            if(rlock.tryLock()) {
                localExecResources.add(new Pair<String, Lock>(path, rlock));
            } else {
                totalLocked++;
                final List<GridNode> replicatedNodes;
View Full Code Here

Examples of java.util.concurrent.locks.ReadWriteLock.readLock()

            throw new NullPointerException("lifecycleManagerRegistry"); //$NON-NLS-1$
        }
        this.lifecycleManagerRegistry = lifecycleManagerRegistry;
        this.cacheByClass = new HashMap<Class<?>, ResourceRecord>();
        ReadWriteLock readWriteLock = new ReentrantReadWriteLock();
        readersLock = readWriteLock.readLock();
        writersLock = readWriteLock.writeLock();

        if (customProperties == null) {
            customProperties = new Properties();
        }
View Full Code Here

Examples of java.util.concurrent.locks.ReadWriteLock.readLock()

    // _lock = new Lock("block:" + store.getName() + ":" + Long.toHexString(_blockId));
    // ReadWriteLock rwLock = new ReentrantReadWriteLock();
    ReadWriteLock rwLock = new ReentrantReadWriteLock();
   
    _readLock = rwLock.readLock();
    _writeLock = rwLock.writeLock();

    _isFlushDirtyOnCommit = _store.isFlushDirtyBlocksOnCommit();

    _buffer = allocateBuffer();
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.