Skip to content

Commit

Permalink
Backport a25bae8
Browse files Browse the repository at this point in the history
  • Loading branch information
Rudometov committed Oct 26, 2022
1 parent 3c1e0cf commit 655d984
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/hotspot/share/runtime/os.cpp
Expand Up @@ -864,7 +864,7 @@ int os::random() {
while (true) {
unsigned int seed = _rand_seed;
unsigned int rand = random_helper(seed);
if (Atomic::cmpxchg(rand, &_rand_seed, seed) == seed) {
if (Atomic::cmpxchg(rand, &_rand_seed, seed, memory_order_relaxed) == seed) {
return static_cast<int>(rand);
}
}
Expand Down

0 comments on commit 655d984

Please sign in to comment.