Examples of writeLock()


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

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

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

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

            Thread.sleep(randomNum);
          } catch (InterruptedException e) {
            e.printStackTrace();
          }
         
          Lock rl = rwl.writeLock();
          rl.lock();
          atom.incrementAndGet();
          rl.unlock();
         
          Lock wl = rwl.readLock();
View Full Code Here

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

    this.credentials = credentials;
    this.aclsManager = context.getApplicationACLsManager();
    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

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

    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

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

    reportedStatus = new TaskAttemptStatus();
    initTaskAttemptStatus(reportedStatus);

    ReadWriteLock readWriteLock = new ReentrantReadWriteLock();
    readLock = readWriteLock.readLock();
    writeLock = readWriteLock.writeLock();

    this.credentials = credentials;
    this.jobToken = jobToken;
    this.eventHandler = eventHandler;
    this.jobFile = jobFile;
View Full Code Here

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

        }
        this.lifecycleManagerRegistry = lifecycleManagerRegistry;
        this.cacheByClass = new HashMap<Class<?>, ResourceRecord>();
        ReadWriteLock readWriteLock = new ReentrantReadWriteLock();
        readersLock = readWriteLock.readLock();
        writersLock = readWriteLock.writeLock();
    }

    /**
     * Gets a resource record from a cache of records for the specified resource
     * class. If there is no record in the cache, then a new record is created
View Full Code Here

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

    }

    // 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

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

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

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

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

                             ApplicationValidator applicationValidator) {
        this.factoryFactoryRegistry = factoryRegistry;
        this.applicationValidator = applicationValidator;
        ReadWriteLock readWriteLock = new ReentrantReadWriteLock();
        readersLock = readWriteLock.readLock();
        writersLock = readWriteLock.writeLock();
    }

    @SuppressWarnings("unchecked")
    public boolean addProvider(Class<?> cls, double priority) {
        if (cls == null) {
View Full Code Here

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

        rootResources = new LinkedList<ResourceRecord>();
        dirty = false;
        resourceRecordsFactory = new ResourceRecordFactory(factoryRegistry);
        ReadWriteLock readWriteLock = new ReentrantReadWriteLock();
        readersLock = readWriteLock.readLock();
        writersLock = readWriteLock.writeLock();
    }

    /**
     * Add a resource as an object to the registry
     *
 
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.