Lines Matching full:tail
18 /// If the stamp equals the tail, this node will be next written to. If it equals head + 1,
58 /// The tail of the queue.
63 /// Elements are pushed into the tail of the queue.
64 tail: CachePadded<AtomicUsize>, field
97 // Tail is initialized to `{ lap: 0, index: 0 }`. in new()
99 let tail = 0; in new() localVariable
121 tail: CachePadded::new(AtomicUsize::new(tail)), in new()
130 let mut tail = self.tail.load(Ordering::Relaxed); in push_or_else() localVariable
133 // Deconstruct the tail. in push_or_else()
134 let index = tail & (self.one_lap - 1); in push_or_else()
135 let lap = tail & !(self.one_lap - 1); in push_or_else()
140 tail + 1 in push_or_else()
152 // If the tail and the stamp match, we may attempt to push. in push_or_else()
153 if tail == stamp { in push_or_else()
154 // Try moving the tail. in push_or_else()
155 match self.tail.compare_exchange_weak( in push_or_else()
156 tail, in push_or_else()
166 slot.stamp.store(tail + 1, Ordering::Release); in push_or_else()
170 tail = t; in push_or_else()
174 } else if stamp.wrapping_add(self.one_lap) == tail + 1 { in push_or_else()
176 value = f(value, tail, new_tail, slot)?; in push_or_else()
178 tail = self.tail.load(Ordering::Relaxed); in push_or_else()
182 tail = self.tail.load(Ordering::Relaxed); in push_or_else()
202 self.push_or_else(value, |v, tail, _, _| { in push()
205 // If the head lags one lap behind the tail as well... in push()
206 if head.wrapping_add(self.one_lap) == tail { in push()
233 self.push_or_else(value, |v, tail, new_tail, slot| { in force_push()
234 let head = tail.wrapping_sub(self.one_lap); in force_push()
243 // Move the tail. in force_push()
244 self.tail.store(new_tail, Ordering::SeqCst); in force_push()
250 slot.stamp.store(tail + 1, Ordering::Release); in force_push()
322 let tail = self.tail.load(Ordering::Relaxed); in pop() localVariable
324 // If the tail equals the head, that means the channel is empty. in pop()
325 if tail == head { in pop()
369 let tail = self.tail.load(Ordering::SeqCst); in is_empty() localVariable
371 // Is the tail lagging one lap behind head? in is_empty()
372 // Is the tail equal to the head? in is_empty()
374 // Note: If the head changes just before we load the tail, that means there was a moment in is_empty()
376 tail == head in is_empty()
393 let tail = self.tail.load(Ordering::SeqCst); in is_full() localVariable
396 // Is the head lagging one lap behind tail? in is_full()
398 // Note: If the tail changes just before we load the head, that means there was a moment in is_full()
400 head.wrapping_add(self.one_lap) == tail in is_full()
421 // Load the tail, then load the head. in len()
422 let tail = self.tail.load(Ordering::SeqCst); in len() localVariable
425 // If the tail didn't change, we've got consistent values to work with. in len()
426 if self.tail.load(Ordering::SeqCst) == tail { in len()
428 let tix = tail & (self.one_lap - 1); in len()
434 } else if tail == head { in len()
448 let tail = *self.tail.get_mut(); in drop() localVariable
451 let tix = tail & (self.one_lap - 1); in drop()
457 } else if tail == head { in drop()
509 if value.head.get_mut() != value.tail.get_mut() { in next()