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?

http://cr.openjdk.java.net/~mullan/webrevs/7093090/webrev.00/

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.

Thanks,
Sean



More information about the security-dev mailing list