Catching up...

As implied in other posts, the minimal fix is to add a trailing release fence (using Unsafe?) to the constructor. Or less delicately, to access only using acquire/release (which will cost a bit on ARM/Power, but probably not noticeable on x86), or most simply (but expensively) to declare the field volatile.

Also, as Hans noted, the consensus seems to be that there not enough to be gained by always adding a release fence to constructors. A few errors like this might never occur, but other related anomalies with non-final field accesses would remain.

-Doug

Reply via email to