mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-14 02:21:25 +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.AtomicIntegerFieldUpdater;
|
||||
|
||||
class Atomics {
|
||||
private volatile int num;
|
||||
|
||||
public void set(int n) {
|
||||
AtomicIntegerFieldUpdater<Atomics> updater = AtomicIntegerFieldUpdater.newUpdater(Atomics.class, "num");
|
||||
updater.set(this, n);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user