From 2287e7a62bcd2abb09b2472a08c7dae8815d39c7 Mon Sep 17 00:00:00 2001 From: Janggun Lee Date: Thu, 17 Oct 2024 16:30:24 +0900 Subject: [PATCH] Update comment --- src/lockfree/list.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/lockfree/list.rs b/src/lockfree/list.rs index 812b98eb07..6877d5b46e 100644 --- a/src/lockfree/list.rs +++ b/src/lockfree/list.rs @@ -154,9 +154,11 @@ where let mut node = prev_next; while node.with_tag(0) != self.curr { // SAFETY: All nodes in the unlinked chain are not null. - // NOTE: This load could be non-atomic, but `crossbeam-epoch`'s atomics does not support - // such fine-grained access options. `core` atomics have `as_ptr()`. + // + // NOTE: It may seem like this load could be non-atomic, but that would + // race with the `fetch_or` done in `remove`. let next = unsafe { node.deref() }.next.load(Relaxed, guard); + // SAFETY: we unlinked the chain with above CAS. unsafe { guard.defer_destroy(node) }; node = next;