Package java.util.concurrent.locks

Examples of java.util.concurrent.locks.ReentrantReadWriteLock


    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();
    }
View Full Code Here


                  boolean restoreBuffer, File mmapSessionDirectory, AssertLevel assertLevel,
                  boolean enabled, ByteOrder byteOrder)
  {
    _enabled = enabled;
    _assertLevel = null != assertLevel ? assertLevel : AssertLevel.NONE;
    rwLock = new ReentrantReadWriteLock();
    maxElements = maxIndexSize/SIZE_OF_SCN_OFFSET_RECORD;
    int proposedBlockSize = (int) (totalAddressedSpace / maxElements);
    if ((1L * proposedBlockSize * maxElements)< totalAddressedSpace)
    {
      proposedBlockSize++;
View Full Code Here

{
  private final ReadWriteLock _readWriteLock;

  protected ReadWriteSyncedObject(boolean threadSafe)
  {
    _readWriteLock = threadSafe ? new ReentrantReadWriteLock(true) : null;
  }
View Full Code Here

     * @param v The vector to decorate.
     */
    public AtomicVector(DoubleVector v) {
        vector = v;

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

     * @param v The vector to decorate.
     */
    public AtomicSparseVector(SparseDoubleVector v) {
        vector = v;

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

    public AtomicGrowingMatrix() {
        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

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

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

    Lock readLock = lock.readLock();
    acquireLock( key, timeout, readLock );
  }

  private ReadWriteLock getLock(EntityKey key) {
    ReadWriteLock newLock = new ReentrantReadWriteLock();
    ReadWriteLock previous = dataLocks.putIfAbsent( key, newLock );
    return previous != null ? previous : newLock;
  }
View Full Code Here

  public Job()
  {
    jobTasks = new ArrayList<JobTask>();
    threshold = new Threshold(5000);
    trunkLock = new ReentrantReadWriteLock();
    loadLock = new ReentrantLock();
    waitlock = new ReentrantLock();
    waitToJobReset = waitlock.newCondition();
    merged = new AtomicBoolean(false);
        merging = new AtomicBoolean(false);
View Full Code Here

  public FilePool(Configuration conf, Path input) throws IOException {
    root = null;
    this.conf = conf;
    this.path = input;
    this.fs = path.getFileSystem(conf);
    updateLock = new ReentrantReadWriteLock();
  }
View Full Code Here

TOP

Related Classes of java.util.concurrent.locks.ReentrantReadWriteLock

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.