mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-18 20:41:22 +07:00
Java: Take into account writes to the field done via AtomicFieldUpdater (IDEA-152262)
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
import java.util.concurrent.atomic.AtomicLongFieldUpdater;
|
||||
|
||||
class Atomics {
|
||||
private volatile long num;
|
||||
|
||||
public void set(long n) {
|
||||
AtomicLongFieldUpdater<Atomics> updater = AtomicLongFieldUpdater.newUpdater(Atomics.class, "num");
|
||||
updater.set(this, n);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user