< prev index next >
src/share/vm/runtime/os.cpp
Print this page
rev 13430 : imported patch fix_calls
*** 753,765 ****
int os::random() {
// Make updating the random seed thread safe.
while (true) {
unsigned int seed = _rand_seed;
! int rand = random_helper(seed);
if (Atomic::cmpxchg(rand, &_rand_seed, seed) == seed) {
! return rand;
}
}
}
// The INITIALIZED state is distinguished from the SUSPENDED state because the
--- 753,765 ----
int os::random() {
// Make updating the random seed thread safe.
while (true) {
unsigned int seed = _rand_seed;
! unsigned int rand = random_helper(seed);
if (Atomic::cmpxchg(rand, &_rand_seed, seed) == seed) {
! return static_cast<int>(rand);
}
}
}
// The INITIALIZED state is distinguished from the SUSPENDED state because the
< prev index next >