assumes no push or pop in progress
| 125 | |
| 126 | // assumes no push or pop in progress |
| 127 | void clear() { |
| 128 | Node* x; |
| 129 | while ((x = a.pop())) free(x); |
| 130 | while ((x = b.pop())) free(x); |
| 131 | } |
| 132 | |
| 133 | concurrent_stack() {} |
| 134 | ~concurrent_stack() { clear(); } |