stable.rs
SHA-256849374549a707a5238408e0aa30a2438babf817e4f30e338d61fbff297e64f1b
Malecule∅
Evidence
1:9… ight 2016 Amanieu d'Antras
2//
3// Licensed under the Apache License, Version 2.0, <LICENSE-APACHE or
4// http://apache.org/licenses/LICENSE-2.0> or t …
5:9… //opensource.org/licenses/MIT>, at your option. This file may not be
6// copied, modified, or distributed except according to those terms.
7
8#![allow(dead_code)]
9
10use std::sync::atomic;
11
12// Re-export this for convenience
13pub use std::sync::atomic::{Ordering, fence};
14
15// Wrapper around AtomicUsize for non-nightly which has usable compare_exchange
16// and compare_exchange_weak methods.
17pub struct AtomicUsize(atomic::AtomicUsize);
18pub use self::AtomicUsize as AtomicU8;
19
20// Constants for static initialization
21pub const ATOMIC_USIZE_INIT: AtomicUsize = AtomicUsize(atomic::ATOMIC_USIZE_INIT);
22pub use self::ATOMIC_USIZE_INIT as ATOMIC_U8_INIT;
23
24impl AtomicUsize {
25 #[inline]
26 pub fn new(val: usize) -> AtomicUsize …