diff options
| author | Aaron Turon <aturon@mozilla.com> | 2014-08-04 15:42:36 -0700 |
|---|---|---|
| committer | Aaron Turon <aturon@mozilla.com> | 2014-08-04 16:03:21 -0700 |
| commit | 68bde0a07396efb415d61047c6b2a8183f47ef30 (patch) | |
| tree | 2a0d63e3153abbe4f62f15d06ee72c94c7772b2d /src/libstd/io | |
| parent | 9de20198aedb3c3419ee503755e04bcc198d3a94 (diff) | |
stabilize atomics (now atomic)
This commit stabilizes the `std::sync::atomics` module, renaming it to `std::sync::atomic` to match library precedent elsewhere, and tightening up behavior around incorrect memory ordering annotations. The vast majority of the module is now `stable`. However, the `AtomicOption` type has been deprecated, since it is essentially unused and is not truly a primitive atomic type. It will eventually be replaced by a higher-level abstraction like MVars. Due to deprecations, this is a: [breaking-change]
Diffstat (limited to 'src/libstd/io')
| -rw-r--r-- | src/libstd/io/tempfile.rs | 6 | ||||
| -rw-r--r-- | src/libstd/io/test.rs | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/src/libstd/io/tempfile.rs b/src/libstd/io/tempfile.rs index f580dfd80f0..1d53ed81437 100644 --- a/src/libstd/io/tempfile.rs +++ b/src/libstd/io/tempfile.rs @@ -19,7 +19,7 @@ use option::{Option, None, Some}; use os; use path::{Path, GenericPath}; use result::{Ok, Err}; -use sync::atomics; +use sync::atomic; #[cfg(stage0)] use iter::Iterator; // NOTE(stage0): Remove after snapshot. @@ -42,13 +42,13 @@ impl TempDir { return TempDir::new_in(&os::make_absolute(tmpdir), suffix); } - static mut CNT: atomics::AtomicUint = atomics::INIT_ATOMIC_UINT; + static mut CNT: atomic::AtomicUint = atomic::INIT_ATOMIC_UINT; for _ in range(0u, 1000) { let filename = format!("rs-{}-{}-{}", unsafe { libc::getpid() }, - unsafe { CNT.fetch_add(1, atomics::SeqCst) }, + unsafe { CNT.fetch_add(1, atomic::SeqCst) }, suffix); let p = tmpdir.join(filename); match fs::mkdir(&p, io::UserRWX) { diff --git a/src/libstd/io/test.rs b/src/libstd/io/test.rs index 26e854d9d99..331cfa1a59e 100644 --- a/src/libstd/io/test.rs +++ b/src/libstd/io/test.rs @@ -16,7 +16,7 @@ use libc; use os; use prelude::*; use std::io::net::ip::*; -use sync::atomics::{AtomicUint, INIT_ATOMIC_UINT, Relaxed}; +use sync::atomic::{AtomicUint, INIT_ATOMIC_UINT, Relaxed}; macro_rules! iotest ( { fn $name:ident() $b:block $(#[$a:meta])* } => ( |
