Lines Matching refs:tail

27     /// If the stamp equals the tail, this node will be next written to. If it equals head + 1,
65 /// The tail of the queue.
70 /// Elements are pushed into the tail of the queue.
71 tail: CachePadded<AtomicUsize>,
109 let tail = 0;
136 tail: CachePadded::new(AtomicUsize::new(tail)),
157 let mut tail = self.tail.load(Ordering::Relaxed);
160 // Deconstruct the tail.
161 let index = tail & (self.one_lap - 1);
162 let lap = tail & !(self.one_lap - 1);
168 // If the tail and the stamp match, we may attempt to push.
169 if tail == stamp {
173 tail + 1
180 // Try moving the tail.
181 match self.tail.compare_exchange_weak(
182 tail,
192 slot.stamp.store(tail + 1, Ordering::Release);
196 tail = t;
200 } else if stamp.wrapping_add(self.one_lap) == tail + 1 {
204 // If the head lags one lap behind the tail as well...
205 if head.wrapping_add(self.one_lap) == tail {
211 tail = self.tail.load(Ordering::Relaxed);
215 tail = self.tail.load(Ordering::Relaxed);
281 let tail = self.tail.load(Ordering::Relaxed);
283 // If the tail equals the head, that means the channel is empty.
284 if tail == head {
328 let tail = self.tail.load(Ordering::SeqCst);
330 // Is the tail lagging one lap behind head?
331 // Is the tail equal to the head?
333 // Note: If the head changes just before we load the tail, that means there was a moment
335 tail == head
352 let tail = self.tail.load(Ordering::SeqCst);
355 // Is the head lagging one lap behind tail?
357 // Note: If the tail changes just before we load the head, that means there was a moment
359 head.wrapping_add(self.one_lap) == tail
380 // Load the tail, then load the head.
381 let tail = self.tail.load(Ordering::SeqCst);
384 // If the tail didn't change, we've got consistent values to work with.
385 if self.tail.load(Ordering::SeqCst) == tail {
387 let tix = tail & (self.one_lap - 1);
393 } else if tail == head {