Package java.util.concurrent.atomic

Examples of java.util.concurrent.atomic.AtomicBoolean.weakCompareAndSet()


    }

    @Test
    public void weakCompareAndSet() throws Exception {
        AtomicBoolean value = new AtomicBoolean();
        assert value.weakCompareAndSet(false, true);

        value.set(true);
        assert !value.weakCompareAndSet(false, false);
    }
View Full Code Here


    public void weakCompareAndSet() throws Exception {
        AtomicBoolean value = new AtomicBoolean();
        assert value.weakCompareAndSet(false, true);

        value.set(true);
        assert !value.weakCompareAndSet(false, false);
    }

    @Test
    public void lazySet() throws Exception {
        AtomicBoolean value = new AtomicBoolean();
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.