use core::sync::atomic::{self, AtomicPtr, AtomicBool};
pub struct Queue<T: Send> {
head: NodePtr<T>,
count: AtomicIsize,
hp: AtomicPtr<[T]>,
tid_map: AtomicPtr<i32>,
is_freeing: AtomicBool,
free_pool_head: NodePtr<T>,
free_pool_tail: NodePtr<T>,
tail: NodePtr<T>,
}
type NodePtr<T> = AtomicPtr<Node<T>>;
struct Node<T: Send> {
next: NodePtr<T>,
val: T,
can_free: AtomicBool,
}
const MAXFREE = 150;
impl <T: Send> Queue<T> {
pub const fn new() -> Queue<T> {
Queue{}
}
pub fn with_capacity() -> Queue<T> {
}
pub fn enqueue(&self, val: T) {
}
pub fn dequeue(&self) -> Option<T> {
}
fn count_free(&self) -> i32 {
}
fn dequeue_tid(&self) -> i32 {
}
fn in_hp(&self, NodePtr<T>) -> bool {
}
}