mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-08 17:20:11 +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()) {
|
||||
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
|
||||
|
Loading…
Reference in New Issue
Block a user