src/hotspot/share/utilities/lockFreeStack.hpp
changeset 59251 4cbfa5077d68
parent 59248 e92153ed8bdc
child 59252 623722a6aeb9
equal deleted inserted replaced
59250:a6deb69743d4 59251:4cbfa5077d68
   101 
   101 
   102   // Atomically exchange the list of elements with NULL, returning the old
   102   // Atomically exchange the list of elements with NULL, returning the old
   103   // list of elements.  Acts as a full memory barrier.
   103   // list of elements.  Acts as a full memory barrier.
   104   // postcondition: empty()
   104   // postcondition: empty()
   105   T* pop_all() {
   105   T* pop_all() {
   106     return Atomic::xchg((T*)NULL, &_top);
   106     return Atomic::xchg(&_top, (T*)NULL);
   107   }
   107   }
   108 
   108 
   109   // Atomically adds value to the top of this stack.  Acts as a full
   109   // Atomically adds value to the top of this stack.  Acts as a full
   110   // memory barrier.
   110   // memory barrier.
   111   void push(T& value) {
   111   void push(T& value) {