Package java.util.concurrent.atomic

Examples of java.util.concurrent.atomic.AtomicLongArray.compareAndSet()


            // determine what the new long value will be after we set the appropriate bit.
            long currentLongValue = segment.get(longPosition);
            long newLongValue = currentLongValue | mask;

            // if no other thread has modified the value since we read it, we won the race and we are done.
            if(segment.compareAndSet(longPosition, currentLongValue, newLongValue))
                break;
        }
    }

    public boolean get(int position) {
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.