Commit ddae4c10 authored by Him188's avatar Him188

Fix concurrent remove

parent b38f8252
...@@ -132,7 +132,10 @@ open class LockFreeLinkedList<E> { ...@@ -132,7 +132,10 @@ open class LockFreeLinkedList<E> {
if (toRemove.isRemoved()) { if (toRemove.isRemoved()) {
continue continue
} }
toRemove.removed.value = true // logically remove: all the operations will recognize this node invalid if (!toRemove.removed.compareAndSet(false, true)) {
// logically remove: all the operations will recognize this node invalid
continue
}
// physically remove: try to fix the link // physically remove: try to fix the link
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment