Examples of ReentrantLock


Examples of java.util.concurrent.locks.ReentrantLock

    Node(T item) {      // usual constructor
      this.item = item;
      this.key = item.hashCode();
      this.next = null;
      this.marked = false;
      this.lock = new ReentrantLock();
    }
View Full Code Here

Examples of java.util.concurrent.locks.ReentrantLock

    Node(int key) { // sentinel constructor
      this.item = null;
      this.key = key;
      this.next = null;
      this.marked = false;
      this.lock = new ReentrantLock();
    }
View Full Code Here

Examples of java.util.concurrent.locks.ReentrantLock

    public StripedHashSet(int capacity) {
        super(capacity);
        locks = new Lock[capacity];
        for(int j = 0; j < locks.length; j++) {
            locks[j] = new ReentrantLock();
        }
    }
View Full Code Here

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

Examples of java.util.concurrent.locks.ReentrantLock

     * 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

Examples of java.util.concurrent.locks.ReentrantLock

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

Examples of java.util.concurrent.locks.ReentrantLock

     * @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

Examples of java.util.concurrent.locks.ReentrantLock

        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

Examples of java.util.concurrent.locks.ReentrantLock

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

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

Examples of java.util.concurrent.locks.ReentrantLock

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