We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e9c4a63 commit bc67cfeCopy full SHA for bc67cfe
1 file changed
src/queue.rs
@@ -397,6 +397,7 @@ where
397
// Swap buffers: previous dequeuing buffer become the enqueuing one
398
let next_enqueuing = EnqueuingCapacity::new(next_buffer_index, next_capa - inserted_length);
399
let mut backoff = 0;
400
+ // `AtomicUsize::swap` cannot be used directly, as the queue might be closed concurrently
401
while let Err(enq) = self.enqueuing_capacity.compare_exchange_weak(
402
enqueuing.into_atomic(),
403
next_enqueuing.with_closed(enqueuing).into_atomic(),
0 commit comments