If you look at the source, you will receive the correct answer, which is YES and NO about ordering guarantees. It depends on which method is being called. Some support warranties are ordered and some are not.
The following source shows that it supports both modes depending on which method is called.
138
150 public final boolean weakCompareAndSet(int expect, int update) {
151 return unsafe.compareAndSwapInt(this, valueOffset, expect, update);
152 }
If in doubt, read the JavaDoc, and if still unclear, read the source.
source
share