Example usage for java.util.concurrent.atomic AtomicMarkableReference AtomicMarkableReference

List of usage examples for java.util.concurrent.atomic AtomicMarkableReference AtomicMarkableReference

Introduction

In this page you can find the example usage for java.util.concurrent.atomic AtomicMarkableReference AtomicMarkableReference.

Prototype

public AtomicMarkableReference(V initialRef, boolean initialMark) 

Source Link

Document

Creates a new AtomicMarkableReference with the given initial values.

Usage

From source file:RefinableHashSet.java

/**
 * Concurrent Cuckoo hash set. Resizes lock array.
 * @param capacity Initial number of buckets.
 *///from   ww  w.j a  va2 s  .  c  o m
public RefinableHashSet(int capacity) {
    super(capacity);
    locks = new ReentrantLock[capacity];
    for (int j = 0; j < capacity; j++) {
        locks[j] = new ReentrantLock();
    }
    owner = new AtomicMarkableReference<Thread>(null, false);
}