rollup merge of #24329: GuillaumeGomez/atomicbool

Fixes #24319.
This commit is contained in:
Alex Crichton 2015-04-14 10:55:42 -07:00
commit 1c7ade986f

View File

@ -78,12 +78,20 @@ use intrinsics;
use cell::UnsafeCell;
use marker::PhantomData;
use default::Default;
/// A boolean type which can be safely shared between threads.
#[stable(feature = "rust1", since = "1.0.0")]
pub struct AtomicBool {
v: UnsafeCell<usize>,
}
impl Default for AtomicBool {
fn default() -> AtomicBool {
ATOMIC_BOOL_INIT
}
}
unsafe impl Sync for AtomicBool {}
/// A signed integer type which can be safely shared between threads.
@ -92,6 +100,12 @@ pub struct AtomicIsize {
v: UnsafeCell<isize>,
}
impl Default for AtomicIsize {
fn default() -> AtomicIsize {
ATOMIC_ISIZE_INIT
}
}
unsafe impl Sync for AtomicIsize {}
/// An unsigned integer type which can be safely shared between threads.
@ -100,6 +114,12 @@ pub struct AtomicUsize {
v: UnsafeCell<usize>,
}
impl Default for AtomicUsize {
fn default() -> AtomicUsize {
ATOMIC_USIZE_INIT
}
}
unsafe impl Sync for AtomicUsize {}
/// A raw pointer type which can be safely shared between threads.