Examples of readLock()


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

    }

    @Test
    public void testWithLocking() {
        ReentrantReadWriteLock readWriteLock = dhns.getReadWriteLock();
        Lock lock = readWriteLock.readLock();

        for (int i = 0; i < 100000; i++) {
            lock.lock();
            int degree = singleNode.getEdgesInTree().getCount() + singleNode.getEdgesOutTree().getCount();
            lock.unlock();
View Full Code Here

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

    }

    @Test
    public void testWithGlobalLocking() {
        ReentrantReadWriteLock readWriteLock = dhns.getReadWriteLock();
        Lock lock = readWriteLock.readLock();

        lock.lock();
        for (int i = 0; i < 100000; i++) {
            lock.lock();
            int degree = singleNode.getEdgesInTree().getCount() + singleNode.getEdgesOutTree().getCount();
View Full Code Here

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

    public void readUnlockAll() {
        ReentrantReadWriteLock lock = readWriteLock;
        final int nReadLocks = lock.getReadHoldCount();
        for (int n = 0; n < nReadLocks; n++) {
            lock.readLock().unlock();
        }
    }

    public void writeLock() {
        if (readWriteLock.getReadHoldCount() > 0) {
View Full Code Here

Examples of java.util.concurrent.locks.ReentrantReadWriteLock.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.ReentrantReadWriteLock.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

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

    private Set<DispatchType> dispatches = new CopyOnWriteArraySet<>();

    public SocketWrapper(E socket) {
        this.socket = socket;
        ReentrantReadWriteLock lock = new ReentrantReadWriteLock();
        this.blockingStatusReadLock = lock.readLock();
        this.blockingStatusWriteLock = lock.writeLock();
    }

    public E getSocket() {
        return socket;
View Full Code Here

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

     */
    public AtomicVector(DoubleVector v) {
        vector = v;

        ReentrantReadWriteLock rwLock = new ReentrantReadWriteLock();
        readLock = rwLock.readLock();
        writeLock = rwLock.writeLock();
    }
   
    /**
     * {@inheritDoc}
 
View Full Code Here

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

     */
    public AtomicSparseVector(SparseDoubleVector v) {
        vector = v;

        ReentrantReadWriteLock rwLock = new ReentrantReadWriteLock();
        readLock = rwLock.readLock();
        writeLock = rwLock.writeLock();
    }
   
    /**
     * {@inheritDoc}
 
View Full Code Here

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

        this.rows = new AtomicInteger(0);
        this.cols = new AtomicInteger(0);
        sparseMatrix = new IntegerMap<AtomicVector>();
       
        ReentrantReadWriteLock rwLock = new ReentrantReadWriteLock();
        rowReadLock = rwLock.readLock();
        rowWriteLock = rwLock.writeLock();

        rwLock = new ReentrantReadWriteLock();
        denseArrayReadLock = rwLock.readLock();
        denseArrayWriteLock = rwLock.writeLock();
View Full Code Here

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

        ReentrantReadWriteLock rwLock = new ReentrantReadWriteLock();
        rowReadLock = rwLock.readLock();
        rowWriteLock = rwLock.writeLock();

        rwLock = new ReentrantReadWriteLock();
        denseArrayReadLock = rwLock.readLock();
        denseArrayWriteLock = rwLock.writeLock();
    }
   
    /**
     * {@inheritDoc}
 
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.