< prev index next >
src/hotspot/share/services/mallocSiteTable.cpp
Print this page
*** 126,136 ****
MallocSiteHashtableEntry* entry = new_entry(key, flags);
// OOM check
if (entry == NULL) return NULL;
// swap in the head
! if (Atomic::replace_if_null(entry, &_table[index])) {
return entry->data();
}
delete entry;
}
--- 126,136 ----
MallocSiteHashtableEntry* entry = new_entry(key, flags);
// OOM check
if (entry == NULL) return NULL;
// swap in the head
! if (Atomic::replace_if_null(&_table[index], entry)) {
return entry->data();
}
delete entry;
}
*** 227,237 ****
// make counter negative to block out shared locks
do {
val = *_lock;
target = _MAGIC_ + *_lock;
! } while (Atomic::cmpxchg(target, _lock, val) != val);
// wait for all readers to exit
while (*_lock != _MAGIC_) {
#ifdef _WINDOWS
os::naked_short_sleep(1);
--- 227,237 ----
// make counter negative to block out shared locks
do {
val = *_lock;
target = _MAGIC_ + *_lock;
! } while (Atomic::cmpxchg(_lock, val, target) != val);
// wait for all readers to exit
while (*_lock != _MAGIC_) {
#ifdef _WINDOWS
os::naked_short_sleep(1);
*** 241,247 ****
}
_lock_state = ExclusiveLock;
}
bool MallocSiteHashtableEntry::atomic_insert(MallocSiteHashtableEntry* entry) {
! return Atomic::replace_if_null(entry, &_next);
}
--- 241,247 ----
}
_lock_state = ExclusiveLock;
}
bool MallocSiteHashtableEntry::atomic_insert(MallocSiteHashtableEntry* entry) {
! return Atomic::replace_if_null(&_next, entry);
}
< prev index next >