mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-17 17:44:40 +02:00
8182554: Code for os::random() assumes long is 32 bits
And make updating the _rand_seed thread safe. Reviewed-by: stuefe, kbarrett, stefank
This commit is contained in:
parent
edb4b7df3e
commit
9edb2c5e5a
8 changed files with 71 additions and 58 deletions
|
@ -672,8 +672,7 @@ static markOop ReadStableMark(oop obj) {
|
|||
static inline intptr_t get_next_hash(Thread * Self, oop obj) {
|
||||
intptr_t value = 0;
|
||||
if (hashCode == 0) {
|
||||
// This form uses an unguarded global Park-Miller RNG,
|
||||
// so it's possible for two threads to race and generate the same RNG.
|
||||
// This form uses global Park-Miller RNG.
|
||||
// On MP system we'll have lots of RW access to a global, so the
|
||||
// mechanism induces lots of coherency traffic.
|
||||
value = os::random();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue