< prev index next >

src/hotspot/share/runtime/os.cpp

Print this page

        

*** 666,676 **** size_t words = (alloc_size / BytesPerWord); if ((cur_malloc_words + words) > MallocMaxTestWords) { return true; } ! Atomic::add(words, &cur_malloc_words); } return false; } void* os::malloc(size_t size, MEMFLAGS flags) { --- 666,676 ---- size_t words = (alloc_size / BytesPerWord); if ((cur_malloc_words + words) > MallocMaxTestWords) { return true; } ! Atomic::add(&cur_malloc_words, words); } return false; } void* os::malloc(size_t size, MEMFLAGS flags) {
*** 853,863 **** 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); } } } --- 853,863 ---- 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_seed, seed, rand) == seed) { return static_cast<int>(rand); } } }
*** 1802,1812 **** * returns the state set after the method is complete */ os::SuspendResume::State os::SuspendResume::switch_state(os::SuspendResume::State from, os::SuspendResume::State to) { ! os::SuspendResume::State result = Atomic::cmpxchg(to, &_state, from); if (result == from) { // success return to; } return result; --- 1802,1812 ---- * returns the state set after the method is complete */ os::SuspendResume::State os::SuspendResume::switch_state(os::SuspendResume::State from, os::SuspendResume::State to) { ! os::SuspendResume::State result = Atomic::cmpxchg(&_state, from, to); if (result == from) { // success return to; } return result;
< prev index next >