Package java.util.concurrent.atomic

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


    }

    @Test
    public void weakCompareAndSet() throws Exception {
        AtomicInteger value = new AtomicInteger();
        assert value.weakCompareAndSet(0, 10);
        assert value.get() == 10;

        assert !value.weakCompareAndSet(20, 30);
        assert value.get() == 10;
    }
View Full Code Here


    public void weakCompareAndSet() throws Exception {
        AtomicInteger value = new AtomicInteger();
        assert value.weakCompareAndSet(0, 10);
        assert value.get() == 10;

        assert !value.weakCompareAndSet(20, 30);
        assert value.get() == 10;
    }

    @Test
    public void lazySet() throws Exception {
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.