< prev index next >

src/hotspot/share/services/mallocSiteTable.cpp

Print this page
rev 47400 : [mq]: cmpxchg_ptr
rev 47401 : [mq]: cmpxchg_if_null

*** 145,155 **** MallocSiteHashtableEntry* entry = new_entry(key, flags); // OOM check if (entry == NULL) return NULL; // swap in the head ! if (Atomic::cmpxchg_ptr((void*)entry, (volatile void *)&_table[index], NULL) == NULL) { return entry->data(); } delete entry; } --- 145,155 ---- MallocSiteHashtableEntry* entry = new_entry(key, flags); // OOM check if (entry == NULL) return NULL; // swap in the head ! if (Atomic::cmpxchg_if_null(entry, &_table[index])) { return entry->data(); } delete entry; }
*** 255,259 **** --- 255,263 ---- os::naked_yield(); #endif } _lock_state = ExclusiveLock; } + + bool MallocSiteHashtableEntry::atomic_insert(const MallocSiteHashtableEntry* entry) { + return Atomic::cmpxchg_if_null(entry, (const MallocSiteHashtableEntry**)&_next); + }
< prev index next >