diff options
| author | Brian Anderson <banderson@mozilla.com> | 2014-02-24 18:23:01 -0800 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2014-03-20 13:33:43 -0700 |
| commit | 61622dd20cec5d3ec599414cc4720b86d14fd4b1 (patch) | |
| tree | 4c8b296e853797f9ec21209c275ef4158632b647 /src/libstd/sync | |
| parent | 8748322c9b1d4c6fd0ebceb6dc7165b2b50bca4a (diff) | |
| download | rust-61622dd20cec5d3ec599414cc4720b86d14fd4b1.tar.gz rust-61622dd20cec5d3ec599414cc4720b86d14fd4b1.zip | |
std: Remove AtomicU64
Support for this is less universal than for word-size things; it has no users; i'd rather play it safe.
Diffstat (limited to 'src/libstd/sync')
| -rw-r--r-- | src/libstd/sync/atomics.rs | 52 |
1 files changed, 0 insertions, 52 deletions
diff --git a/src/libstd/sync/atomics.rs b/src/libstd/sync/atomics.rs index 5df6fbc4f41..85fe5186298 100644 --- a/src/libstd/sync/atomics.rs +++ b/src/libstd/sync/atomics.rs @@ -134,13 +134,6 @@ pub struct AtomicUint { priv nopod: marker::NoPod } -/// An unsigned atomic integer type that is forced to be 64-bits. This does not -/// support all operations. -pub struct AtomicU64 { - priv v: Unsafe<u64>, - priv nopod: marker::NoPod -} - /// An unsafe atomic pointer. Only supports basic atomic operations pub struct AtomicPtr<T> { priv p: Unsafe<uint>, @@ -198,11 +191,6 @@ pub static INIT_ATOMIC_INT : AtomicInt = AtomicInt { v: Unsafe{value: 0, pub static INIT_ATOMIC_UINT : AtomicUint = AtomicUint { v: Unsafe{value: 0, marker1: marker::InvariantType}, nopod: marker::NoPod }; -/// An `AtomicU64` initialized to `0` -pub static INIT_ATOMIC_U64 : AtomicU64 = AtomicU64 { v: Unsafe{value: 0, - marker1: marker::InvariantType}, - nopod: marker::NoPod }; - // NB: Needs to be -1 (0b11111111...) to make fetch_nand work correctly static UINT_TRUE: uint = -1; @@ -478,46 +466,6 @@ impl AtomicInt { } } -// temporary workaround -// it causes link failure on MIPS target -// libgcc doesn't implement 64-bit atomic operations for MIPS32 -#[cfg(not(target_arch = "mips"))] -impl AtomicU64 { - pub fn new(v: u64) -> AtomicU64 { - AtomicU64 { v: Unsafe::new(v), nopod: marker::NoPod } - } - - #[inline] - pub fn load(&self, order: Ordering) -> u64 { - unsafe { atomic_load(self.v.get(), order) } - } - - #[inline] - pub fn store(&self, val: u64, order: Ordering) { - unsafe { atomic_store(self.v.get(), val, order); } - } - - #[inline] - pub fn swap(&self, val: u64, order: Ordering) -> u64 { - unsafe { atomic_swap(self.v.get(), val, order) } - } - - #[inline] - pub fn compare_and_swap(&self, old: u64, new: u64, order: Ordering) -> u64 { - unsafe { atomic_compare_and_swap(self.v.get(), old, new, order) } - } - - #[inline] - pub fn fetch_add(&self, val: u64, order: Ordering) -> u64 { - unsafe { atomic_add(self.v.get(), val, order) } - } - - #[inline] - pub fn fetch_sub(&self, val: u64, order: Ordering) -> u64 { - unsafe { atomic_sub(self.v.get(), val, order) } - } -} - impl AtomicUint { /// Create a new `AtomicUint` pub fn new(v: uint) -> AtomicUint { |
