Hi,

Please review:

  http://cr.openjdk.java.net/~psandoz/jdk9/8160710-thread-to-tlr/webrev/

This patch updates ThreadLocalRandom, Striped64 and LockSupport to use 
VarHandles instead of Unsafe to access fields in Thread, via the 
MethodsHandles.privateLookupIn method.

Since there are three usages of MethodsHandles.privateLookupIn in 
ThreadLocalRandom i consolidated the doPrivileged block in a private static 
helper method, being paranoid i placed some checks to avoid this method being 
potentially abused to circumvent the security check, perhaps that is overkill?

I ran this patch though our test infra a few times and have not observed any 
transient failures.

Thanks,
Paul.

Reply via email to