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/rt/backtrace.rs | |
| parent | 9de20198aedb3c3419ee503755e04bcc198d3a94 (diff) | |
| download | rust-68bde0a07396efb415d61047c6b2a8183f47ef30.tar.gz rust-68bde0a07396efb415d61047c6b2a8183f47ef30.zip | |
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/rt/backtrace.rs')
| -rw-r--r-- | src/libstd/rt/backtrace.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libstd/rt/backtrace.rs b/src/libstd/rt/backtrace.rs index 80493ebb4a9..6c02cc631f5 100644 --- a/src/libstd/rt/backtrace.rs +++ b/src/libstd/rt/backtrace.rs @@ -20,7 +20,7 @@ use option::{Some, None}; use os; use result::{Ok, Err}; use str::StrSlice; -use sync::atomics; +use sync::atomic; use unicode::char::UnicodeChar; pub use self::imp::write; @@ -28,9 +28,9 @@ pub use self::imp::write; // For now logging is turned off by default, and this function checks to see // whether the magical environment variable is present to see if it's turned on. pub fn log_enabled() -> bool { - static mut ENABLED: atomics::AtomicInt = atomics::INIT_ATOMIC_INT; + static mut ENABLED: atomic::AtomicInt = atomic::INIT_ATOMIC_INT; unsafe { - match ENABLED.load(atomics::SeqCst) { + match ENABLED.load(atomic::SeqCst) { 1 => return false, 2 => return true, _ => {} @@ -41,7 +41,7 @@ pub fn log_enabled() -> bool { Some(..) => 2, None => 1, }; - unsafe { ENABLED.store(val, atomics::SeqCst); } + unsafe { ENABLED.store(val, atomic::SeqCst); } val == 2 } |
