< prev index next >

src/hotspot/share/utilities/lockFreeStack.hpp

Print this page

        

*** 63,73 **** T* cur = top(); T* old; do { old = cur; set_next(*last, cur); ! cur = Atomic::cmpxchg(first, &_top, cur); } while (old != cur); } // Noncopyable. LockFreeStack(const LockFreeStack&); --- 63,73 ---- T* cur = top(); T* old; do { old = cur; set_next(*last, cur); ! cur = Atomic::cmpxchg(&_top, cur, first); } while (old != cur); } // Noncopyable. LockFreeStack(const LockFreeStack&);
*** 89,99 **** T* new_top = NULL; if (result != NULL) { new_top = next(*result); } // CAS even on empty pop, for consistent membar bahavior. ! result = Atomic::cmpxchg(new_top, &_top, result); } while (result != old); if (result != NULL) { set_next(*result, NULL); } return result; --- 89,99 ---- T* new_top = NULL; if (result != NULL) { new_top = next(*result); } // CAS even on empty pop, for consistent membar bahavior. ! result = Atomic::cmpxchg(&_top, result, new_top); } while (result != old); if (result != NULL) { set_next(*result, NULL); } return result;
< prev index next >