< prev index next >

src/hotspot/share/services/mallocSiteTable.cpp

Print this page

        

*** 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(entry, &_table[index], (MallocSiteHashtableEntry*)NULL) == NULL) { return entry->data(); } delete entry; }
*** 255,259 **** --- 255,263 ---- os::naked_yield(); #endif } _lock_state = ExclusiveLock; } + + bool MallocSiteHashtableEntry::atomic_insert(MallocSiteHashtableEntry* entry) { + return Atomic::cmpxchg(entry, &_next, (MallocSiteHashtableEntry*)NULL) == NULL; + }
< prev index next >