jdk/src/share/classes/java/lang/Thread.java
Print this page
*** 1991,2006 ****
}
}
// The following three initially uninitialized fields are exclusively
! // managed by class java.util.concurrent.ThreadLocalRandom.
/** The current seed for a ThreadLocalRandom */
long threadLocalRandomSeed;
/** Probe hash value; nonzero if threadLocalRandomSeed initialized */
int threadLocalRandomProbe;
/** Secondary seed isolated from public ThreadLocalRandom sequence */
int threadLocalRandomSecondarySeed;
/* Some private helper methods */
private native void setPriority0(int newPriority);
private native void stop0(Object o);
--- 1991,2015 ----
}
}
// The following three initially uninitialized fields are exclusively
! // managed by class java.util.concurrent.ThreadLocalRandom. These
! // fields are used to build the high-performance PRNGs in the
! // concurrent code, and we can not risk accidental false sharing.
! // Hence, the fields are isolated with @Contended.
!
/** The current seed for a ThreadLocalRandom */
+ @sun.misc.Contended("tlr")
long threadLocalRandomSeed;
+
/** Probe hash value; nonzero if threadLocalRandomSeed initialized */
+ @sun.misc.Contended("tlr")
int threadLocalRandomProbe;
+
/** Secondary seed isolated from public ThreadLocalRandom sequence */
+ @sun.misc.Contended("tlr")
int threadLocalRandomSecondarySeed;
/* Some private helper methods */
private native void setPriority0(int newPriority);
private native void stop0(Object o);