Skip to content

Commit

Permalink
Add atomic module to alloc::sync
Browse files Browse the repository at this point in the history
  • Loading branch information
taiki-e committed Feb 19, 2019
1 parent 8af675a commit f2ef0f9
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion src/liballoc/sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
//! [arc]: struct.Arc.html

use core::any::Any;
use core::sync::atomic;
use core::sync::atomic::Ordering::{Acquire, Relaxed, Release, SeqCst};
use core::borrow;
use core::fmt;
Expand All @@ -29,6 +28,26 @@ use crate::rc::is_dangling;
use crate::string::String;
use crate::vec::Vec;

// Since the current `liballoc` is not a superset of `libcore`,
// using `pub use core::sync::atomic;` will fail with some link errors.
// If `liballoc` becomes a superset of `libcore`, replace this with
// `pub use core::sync::atomic;`.
/// Atomic types
///
/// Atomic types provide primitive shared-memory communication between
/// threads, and are the building blocks of other concurrent
/// types.
///
/// See [`std::sync::atomic`][atomic] for more details.
///
/// [atomic]: ../../../std/sync/atomic/index.html
#[stable(feature = "rust1", since = "1.0.0")]
pub mod atomic {
#[stable(feature = "rust1", since = "1.0.0")]
#[doc(inline)]
pub use core::sync::atomic::*;
}

/// A soft limit on the amount of references that may be made to an `Arc`.
///
/// Going above this limit will abort your program (although not
Expand Down

0 comments on commit f2ef0f9

Please sign in to comment.