Lines Matching full:tail
19 /// If the stamp equals the tail, this node will be next written to. If it equals head + 1,
59 /// The tail of the queue.
64 /// Elements are pushed into the tail of the queue.
65 tail: CachePadded<AtomicUsize>, field
101 // Tail is initialized to `{ lap: 0, index: 0 }`. in new()
103 let tail = 0; in new() localVariable
125 tail: CachePadded::new(AtomicUsize::new(tail)), in new()
134 let mut tail = self.tail.load(Ordering::Relaxed); in push_or_else() localVariable
137 // Deconstruct the tail. in push_or_else()
138 let index = tail & (self.one_lap - 1); in push_or_else()
139 let lap = tail & !(self.one_lap - 1); in push_or_else()
144 tail + 1 in push_or_else()
156 // If the tail and the stamp match, we may attempt to push. in push_or_else()
157 if tail == stamp { in push_or_else()
158 // Try moving the tail. in push_or_else()
159 match self.tail.compare_exchange_weak( in push_or_else()
160 tail, in push_or_else()
170 slot.stamp.store(tail + 1, Ordering::Release); in push_or_else()
174 tail = t; in push_or_else()
178 } else if stamp.wrapping_add(self.one_lap) == tail + 1 { in push_or_else()
180 value = f(value, tail, new_tail, slot)?; in push_or_else()
182 tail = self.tail.load(Ordering::Relaxed); in push_or_else()
186 tail = self.tail.load(Ordering::Relaxed); in push_or_else()
206 self.push_or_else(value, |v, tail, _, _| { in push()
209 // If the head lags one lap behind the tail as well... in push()
210 if head.wrapping_add(self.one_lap) == tail { in push()
237 self.push_or_else(value, |v, tail, new_tail, slot| { in force_push()
238 let head = tail.wrapping_sub(self.one_lap); in force_push()
247 // Move the tail. in force_push()
248 self.tail.store(new_tail, Ordering::SeqCst); in force_push()
254 slot.stamp.store(tail + 1, Ordering::Release); in force_push()
326 let tail = self.tail.load(Ordering::Relaxed); in pop() localVariable
328 // If the tail equals the head, that means the channel is empty. in pop()
329 if tail == head { in pop()
373 let tail = self.tail.load(Ordering::SeqCst); in is_empty() localVariable
375 // Is the tail lagging one lap behind head? in is_empty()
376 // Is the tail equal to the head? in is_empty()
378 // Note: If the head changes just before we load the tail, that means there was a moment in is_empty()
380 tail == head in is_empty()
397 let tail = self.tail.load(Ordering::SeqCst); in is_full() localVariable
400 // Is the head lagging one lap behind tail? in is_full()
402 // Note: If the tail changes just before we load the head, that means there was a moment in is_full()
404 head.wrapping_add(self.one_lap) == tail in is_full()
425 // Load the tail, then load the head. in len()
426 let tail = self.tail.load(Ordering::SeqCst); in len() localVariable
429 // If the tail didn't change, we've got consistent values to work with. in len()
430 if self.tail.load(Ordering::SeqCst) == tail { in len()
432 let tix = tail & (self.one_lap - 1); in len()
438 } else if tail == head { in len()
453 let tail = *self.tail.get_mut(); in drop() localVariable
456 let tix = tail & (self.one_lap - 1); in drop()
462 } else if tail == head { in drop()
514 if value.head.get_mut() != value.tail.get_mut() { in next()