JDK 8 Code Review Request: 7093090 Reduce synchronization in java.security.Policy.getPolicyNoCheck

Sean Mullan sean.mullan at oracle.com
Thu Nov 17 08:58:46 PST 2011

Hi Valerie,

Could you review this one for me?


This one was tricky to fix, but I have confirmed that it does indeed fix the
thread contention issue with the customer that reported this.

The fix involved adding an initialized flag to indicate when the system-wide
policy has been initialized and storing both the flag and the Policy object in
an AtomicReference. Then, I also used the double-check locking idiom to avoid
locking the Policy class when the Policy had already been initialized.


More information about the security-dev mailing list