Re:Using JDK 9 Memory Order Modes
by _old_dude_ on Wednesday March 15, 2017 @05:50PM
(#13880160)
if the field is volatile, you have an happen before relationship between the volatile read of thing before the synchronized block and the volatile write inside the synchronized block, so you have no way to see the object partially initialized.
It only works with the updated semantics of volatile (Java 5+), otherwise you're right.
It only works with the updated semantics of volatile (Java 5+), otherwise you're right.