pub fn new(num_threads_put: usize, num_threads_pop: usize) -> SpmcQueue<T> {
        let node_ptr = Box::into_raw(Box::new(Node {
            id: 0,
            cells: unsafe { mem::zeroed() },
            next: AtomicPtr::default(),
        }));
        // producers
        assert_eq!(num_threads_put, 1);
        let mut put_handles_ = Vec::with_capacity(num_threads_put);
        for _ in 0..num_threads_put {
            put_handles_.push(AtomicPtr::default());
        }
        // consumers
        let mut pop_handles_ = Vec::with_capacity(num_threads_pop);
        for _ in 0..num_threads_pop {
            pop_handles_.push(AtomicPtr::default());
        }

        SpmcQueue {
            threshold: SPMCQUEUE_DEFAULT_THRESHOLD,
            next_reclaim_index: AtomicUsize::new(0),
            next_reclaim_node_ptr: AtomicPtr::new(node_ptr),
            put_node: AtomicPtr::new(node_ptr),
            pop_node: AtomicPtr::new(node_ptr),
            put_index: 0,
            pop_index: AtomicUsize::new(0),
            put_handles: put_handles_,
            pop_handles: pop_handles_,
            stopped: AtomicBool::new(false),
            num_threads_put,
            num_threads_pop,
            barrier: Barrier::new(num_threads_put + num_threads_pop),
        }
    }
/// Create a new, empty queue.
Create a new, empty queue.
Create a new empty queue .
pub fn new(num_threads_put: usize, num_threads_pop: usize) -> SpmcQueue<T> {
        let node_ptr = Box::into_raw(Box::new(Node {
            id: 0,
            cells: unsafe { mem::zeroed() },
            next: AtomicPtr::default(),
        }));
        // producers
        assert_eq!(num_threads_put, 1);
        let mut put_handles_ = Vec::with_capacity(num_threads_put);
        for _ in 0..num_threads_put {
            put_handles_.push(AtomicPtr::default());
        }
        // consumers
        let mut pop_handles_ = Vec::with_capacity(num_threads_pop);
        for _ in 0..num_threads_pop {
            pop_handles_.push(AtomicPtr::default());
        }
        SpmcQueue {
            threshold: SPMCQUEUE_DEFAULT_THRESHOLD,
            next_reclaim_index: AtomicUsize::new(0),
            next_reclaim_node_ptr: AtomicPtr::new(node_ptr),
            put_node: AtomicPtr::new(node_ptr),
            pop_node: AtomicPtr::new(node_ptr),
            put_index: 0,
            pop_index: AtomicUsize::new(0),
            put_handles: put_handles_,
            pop_handles: pop_handles_,
            stopped: AtomicBool::new(false),
            num_threads_put,
            num_threads_pop,
            barrier: Barrier::new(num_threads_put + num_threads_pop),
        }
    }
pub fn new ( num_threads_put : usize , num_threads_pop : usize ) -> SpmcQueue < T > { let node_ptr = Box :: into_raw ( Box :: new ( Node { id : 0 , cells : unsafe { mem :: zeroed ( ) } , next : AtomicPtr :: default ( ) , } ) ) ; // producers assert_eq ! ( num_threads_put 1 ) ; let mut put_handles_ = Vec :: with_capacity ( num_threads_put ) ; for _ in 0 .. num_threads_put { put_handles_ . push ( AtomicPtr :: default ( ) ) ; } // consumers let mut pop_handles_ = Vec :: with_capacity ( num_threads_pop ) ; for _ in 0 .. num_threads_pop { pop_handles_ . push ( AtomicPtr :: default ( ) ) ; } SpmcQueue { threshold : SPMCQUEUE_DEFAULT_THRESHOLD , next_reclaim_index : AtomicUsize :: new ( 0 ) , next_reclaim_node_ptr : AtomicPtr :: new ( node_ptr ) , put_node : AtomicPtr :: new ( node_ptr ) , pop_node : AtomicPtr :: new ( node_ptr ) , put_index : 0 , pop_index : AtomicUsize :: new ( 0 ) , put_handles : put_handles_ , pop_handles : pop_handles_ , stopped : AtomicBool :: new ( false ) , num_threads_put , num_threads_pop , barrier : Barrier :: new ( num_threads_put + num_threads_pop ) , } }
Create a new, empty queue.
Create a new empty queue .
num_threads_put
usize
num_threads_pop
usize