equal
deleted
inserted
replaced
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) { |