• Home
  • Raw
  • Download

Lines Matching full:tail

64     /// The tail of the channel.
70 /// Messages are pushed into the tail of the channel.
71 tail: CachePadded<AtomicUsize>, field
82 /// If this bit is set in the tail, that means the channel is disconnected.
103 // Tail is initialized to `{ lap: 0, mark: 0, index: 0 }`. in with_capacity()
104 let tail = 0; in with_capacity() localVariable
124 tail: CachePadded::new(AtomicUsize::new(tail)), in with_capacity()
143 let mut tail = self.tail.load(Ordering::Relaxed); in start_send() localVariable
147 if tail & self.mark_bit != 0 { in start_send()
153 // Deconstruct the tail. in start_send()
154 let index = tail & (self.mark_bit - 1); in start_send()
155 let lap = tail & !(self.one_lap - 1); in start_send()
162 // If the tail and the stamp match, we may attempt to push. in start_send()
163 if tail == stamp { in start_send()
167 tail + 1 in start_send()
174 // Try moving the tail. in start_send()
175 match self.tail.compare_exchange_weak( in start_send()
176 tail, in start_send()
184 token.array.stamp = tail + 1; in start_send()
188 tail = t; in start_send()
192 } else if stamp.wrapping_add(self.one_lap) == tail + 1 { in start_send()
196 // If the head lags one lap behind the tail as well... in start_send()
197 if head.wrapping_add(self.one_lap) == tail { in start_send()
203 tail = self.tail.load(Ordering::Relaxed); in start_send()
207 tail = self.tail.load(Ordering::Relaxed); in start_send()
277 let tail = self.tail.load(Ordering::Relaxed); in start_recv() localVariable
279 // If the tail equals the head, that means the channel is empty. in start_recv()
280 if (tail & !self.mark_bit) == head { in start_recv()
282 if tail & self.mark_bit != 0 { in start_recv()
449 // Load the tail, then load the head. in len()
450 let tail = self.tail.load(Ordering::SeqCst); in len() localVariable
453 // If the tail didn't change, we've got consistent values to work with. in len()
454 if self.tail.load(Ordering::SeqCst) == tail { in len()
456 let tix = tail & (self.mark_bit - 1); in len()
462 } else if (tail & !self.mark_bit) == head { in len()
480 let tail = self.tail.fetch_or(self.mark_bit, Ordering::SeqCst); in disconnect() localVariable
482 if tail & self.mark_bit == 0 { in disconnect()
493 self.tail.load(Ordering::SeqCst) & self.mark_bit != 0 in is_disconnected()
499 let tail = self.tail.load(Ordering::SeqCst); in is_empty() localVariable
501 // Is the tail equal to the head? in is_empty()
503 // Note: If the head changes just before we load the tail, that means there was a moment in is_empty()
505 (tail & !self.mark_bit) == head in is_empty()
510 let tail = self.tail.load(Ordering::SeqCst); in is_full() localVariable
513 // Is the head lagging one lap behind tail? in is_full()
515 // Note: If the tail changes just before we load the head, that means there was a moment in is_full()
517 head.wrapping_add(self.one_lap) == tail & !self.mark_bit in is_full()
525 let tail = *self.tail.get_mut(); in drop() localVariable
528 let tix = tail & (self.mark_bit - 1); in drop()
534 } else if (tail & !self.mark_bit) == head { in drop()