mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-24 23:20:09 +08:00
Fix concurrent remove
This commit is contained in:
parent
b38f82523f
commit
ddae4c106a
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user