< prev index next >

src/hotspot/share/gc/g1/g1FreeIdSet.cpp

Print this page

        

*** 77,87 **** uint index; while (true) { index = head_index(old_head); assert(index < _size, "invariant"); uintx new_head = make_head(_next[index], old_head); ! new_head = Atomic::cmpxchg(new_head, &_head, old_head); if (new_head == old_head) break; old_head = new_head; } DEBUG_ONLY(_next[index] = Claimed;) return _start + index; --- 77,87 ---- uint index; while (true) { index = head_index(old_head); assert(index < _size, "invariant"); uintx new_head = make_head(_next[index], old_head); ! new_head = Atomic::cmpxchg(&_head, old_head, new_head); if (new_head == old_head) break; old_head = new_head; } DEBUG_ONLY(_next[index] = Claimed;) return _start + index;
*** 93,103 **** assert(_next[index] == Claimed, "precondition"); uintx old_head = Atomic::load(&_head); while (true) { _next[index] = head_index(old_head); uintx new_head = make_head(index, old_head); ! new_head = Atomic::cmpxchg(new_head, &_head, old_head); if (new_head == old_head) break; old_head = new_head; } // Now that id has been released, permit another thread through the gate. _sem.signal(); --- 93,103 ---- assert(_next[index] == Claimed, "precondition"); uintx old_head = Atomic::load(&_head); while (true) { _next[index] = head_index(old_head); uintx new_head = make_head(index, old_head); ! new_head = Atomic::cmpxchg(&_head, old_head, new_head); if (new_head == old_head) break; old_head = new_head; } // Now that id has been released, permit another thread through the gate. _sem.signal();
< prev index next >