orx-concurrent-queue 1.2.0

A high performance and convenient thread safe queue that can concurrently grow and shrink with push, extend, pop and pull capabilities.
Documentation
1
2
3
4
5
6
7
8
9
10
11
use core::sync::atomic::{AtomicUsize, Ordering};

#[inline(always)]
pub fn comp_exch_weak(atom: &AtomicUsize, current: usize, new: usize) -> Result<usize, usize> {
    atom.compare_exchange_weak(current, new, Ordering::Release, Ordering::Relaxed)
}

#[inline(always)]
pub fn comp_exch(atom: &AtomicUsize, current: usize, new: usize) -> Result<usize, usize> {
    atom.compare_exchange(current, new, Ordering::Release, Ordering::Relaxed)
}