Package java.util.concurrent.locks

Examples of java.util.concurrent.locks.ReentrantLock


     * @param item element in list
     */
    Entry(T item) {
      this.item = item;
      this.key = item.hashCode();
      lock = new ReentrantLock();
    }
View Full Code Here


     * Constructor for sentinel entry
     * @param key should be min or max int value
     */
    Entry(int key) {
      this.key = key;
      lock = new ReentrantLock();
    }
View Full Code Here

     * @param item element in list
     */
    Node(T item) {
      this.item = item;
      this.key = item.hashCode();
      this.lock = new ReentrantLock();
    }
View Full Code Here

     * @param key should be min or max int value
     */
    Node(int key) {
      this.item = null;
      this.key = key;
      this.lock = new ReentrantLock();
    }
View Full Code Here

        locks = new Lock[2][LOCKS];
        table = (T[][]) new Object[2][capacity];
        size = capacity;
        for(int i = 0; i < 2; i++) {
            for(int j = 0; j < LOCKS; j++) {
                locks[i][j] = new ReentrantLock();
            }
        }
    }
View Full Code Here

public class CoarseHashSet<T> extends BaseHashSet<T> {
    final Lock lock;

    CoarseHashSet(int capacity) {
        super(capacity);
        lock = new ReentrantLock();
    }
View Full Code Here

     */
    public RWStripedHashSet(int capacity) {
        super(capacity);
        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();
    }
View Full Code Here

    protected static final int LIMIT = 32;
    // used for rehashing
    private Random random;

    public CoarseCuckooHashSet(int capacity) {
        lock = new ReentrantLock();
        table = (T[][]) new Object[2][capacity];
        size = capacity;
        random = new Random();
    }
View Full Code Here

    public StripedCuckooHashSet(int capacity) {
        super(capacity);
        lock = new ReentrantLock[2][capacity];
        for(int i = 0; i < 2; i++) {
            for(int j = 0; j < capacity; j++) {
                lock[i][j] = new ReentrantLock();
            }
        }
    }
View Full Code Here

    public RefinableCuckooHashSet(int capacity) {
        super(capacity);
        locks = new ReentrantLock[2][capacity];
        for(int i = 0; i < 2; i++) {
            for(int j = 0; j < capacity; j++) {
                locks[i][j] = new ReentrantLock();
            }
        }
        owner = new AtomicMarkableReference<Thread>(null, false);
    }
View Full Code Here

TOP

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

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.