- Loading...
...
// "take" a node with marking:
while (true) {
cur = head;
if (!mark_next(cur, &next)) {
// could not mark cur so try again
continue;
}
if (head != cur) {
// head changed while marking cur so try again
unmark_next(cur);
continue;
}
// list head is now marked so switch it to next which also makes list head unmarked
AtomicOrderAccess::release_store(&head, next);
unmark_next(cur); // unmark cur and return it
return cur;
}
...