Examples of UnsafeIntCounter


Examples of xbird.util.concurrent.counter.UnsafeIntCounter

    public CacheEntry(K key, V value, boolean pin) {
        this._key = key;
        this._value = value;
        this._hash = (key == null) ? -1 : _key.hashCode();
        this._pinning = new UnsafeIntCounter(pin ? 1 : 0);
        this._macguffin = 0;
    }
View Full Code Here

Examples of xbird.util.concurrent.counter.UnsafeIntCounter

        }
        return false;
    }

    public boolean pin() {
        final UnsafeIntCounter pinning = _pinning;
        int capa;
        do {
            capa = pinning.get();
            if(capa == -1) {// does not pin when the entry is evicted
                return false;
            }
        } while(!pinning.compareAndSet(capa, capa + 1));
        return true;
    }
View Full Code Here

Examples of xbird.util.concurrent.counter.UnsafeIntCounter

    public CacheEntry(K key, V value) {
        this._key = key;
        this._value = value;
        this._hash = (key == null) ? -1 : _key.hashCode();
        this._pinning = new UnsafeIntCounter(1);
        this._macguffin = 0;
    }
View Full Code Here

Examples of xbird.util.concurrent.counter.UnsafeIntCounter

        }
        return false;
    }

    public final boolean pin() {
        final UnsafeIntCounter pinning = _pinning;
        int capa;
        do {
            capa = pinning.get();
            if(capa == -1) {// does not pin when the entry is evicted
                return false;
            }
        } while(!pinning.compareAndSet(capa, capa + 1));
        return true;
    }
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.