#[stable]
impl AtomicBool {
/// Create a new `AtomicBool`
+ #[inline]
pub fn new(v: bool) -> AtomicBool {
let val = if v { UINT_TRUE } else { 0 };
AtomicBool { v: UnsafeCell::new(val), nocopy: marker::NoCopy }
#[stable]
impl AtomicInt {
/// Create a new `AtomicInt`
+ #[inline]
pub fn new(v: int) -> AtomicInt {
AtomicInt {v: UnsafeCell::new(v), nocopy: marker::NoCopy}
}
#[stable]
impl AtomicUint {
/// Create a new `AtomicUint`
+ #[inline]
pub fn new(v: uint) -> AtomicUint {
AtomicUint { v: UnsafeCell::new(v), nocopy: marker::NoCopy }
}
#[stable]
impl<T> AtomicPtr<T> {
/// Create a new `AtomicPtr`
+ #[inline]
pub fn new(p: *mut T) -> AtomicPtr<T> {
AtomicPtr { p: UnsafeCell::new(p as uint), nocopy: marker::NoCopy }
}