Package java.util.concurrent.locks

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


    protected LockSupport()
    {
        ReentrantReadWriteLock lock = new ReentrantReadWriteLock();

        readLock = lock.readLock();
        writeLock = lock.writeLock();
    }

    /**
     * Locks the shared read lock. Any number of threads may lock the read lock at the same time.
     */
 
View Full Code Here


    this.credentials = creds;
    this.metrics = metrics;
    user = containerTokenIdentifier.getApplicationSubmitter();
    ReadWriteLock readWriteLock = new ReentrantReadWriteLock();
    this.readLock = readWriteLock.readLock();
    this.writeLock = readWriteLock.writeLock();

    stateMachine = stateMachineFactory.make(this);
  }

  private static final ContainerDoneTransition CONTAINER_DONE_TRANSITION =
View Full Code Here

    this.credentials = credentials;
    this.aclsManager = aclsManager;
    this.context = context;
    ReentrantReadWriteLock lock = new ReentrantReadWriteLock();
    readLock = lock.readLock();
    writeLock = lock.writeLock();
    stateMachine = stateMachineFactory.make(this);
  }

  @Override
  public String getUser() {
View Full Code Here

    this.taskAttemptListener = taskAttemptListener;
    this.eventHandler = eventHandler;
    ReadWriteLock readWriteLock = new ReentrantReadWriteLock();
    this.readLock = readWriteLock.readLock();
    this.writeLock = readWriteLock.writeLock();

    this.jobCredentials = jobCredentials;
    this.jobTokenSecretManager = jobTokenSecretManager;

    this.aclsManager = new JobACLsManager(conf);
View Full Code Here

    this.latestNodeHeartBeatResponse.setResponseId(0);

    ReentrantReadWriteLock lock = new ReentrantReadWriteLock();
    this.readLock = lock.readLock();
    this.writeLock = lock.writeLock();

    this.stateMachine = stateMachineFactory.make(this);
   
    this.nodeUpdateQueue = new ConcurrentLinkedQueue<UpdatedContainerInfo>()
  }
View Full Code Here

        waveDomain != null ? ParticipantIdUtil.makeUnsafeSharedDomainParticipantId(waveDomain)
            : null;
    this.storageContinuationExecutor = storageContinuationExecutor;
    ReentrantReadWriteLock readWriteLock = new ReentrantReadWriteLock();
    this.readLock = readWriteLock.readLock();
    this.writeLock = readWriteLock.writeLock();

    waveletStateFuture.addListener(
        new Runnable() {
          @Override
          public void run() {
View Full Code Here

    }

    // Save the content
    ReentrantReadWriteLock l = new ReentrantReadWriteLock();
    try {
      l.writeLock().lock();
      if (this.originalPackagePath != null
          && !"".equals(this.originalPackagePath.trim())) {
        File targetFile = new File(this.originalPackagePath);
        if (!targetFile.exists()
            || !(this.originalPackagePath
View Full Code Here

        }
      } else if (this.output != null) {
        save(this.output);
      }
    } finally {
      l.writeLock().unlock();
    }

    // Clear
    this.contentTypeManager.clearAll();
  }
View Full Code Here

    {
        super(initialEntries, 0.8f, true);
        _maxEntries = maxEntries;
        final ReentrantReadWriteLock rwl = new ReentrantReadWriteLock();
        _readLock = rwl.readLock();
        _writeLock = rwl.writeLock();
    }

    @Override
    protected boolean removeEldestEntry(Map.Entry<K,V> eldest) {
        return size() > _maxEntries;
View Full Code Here

  private final SearchFactoryImplementor searchFactoryImplementor;

  public StatisticsImpl(SearchFactoryImplementor searchFactoryImplementor) {
    ReadWriteLock lock = new ReentrantReadWriteLock();
    readLock = lock.readLock();
    writeLock = lock.writeLock();

    this.searchFactoryImplementor = searchFactoryImplementor;
  }

  @Override
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.