core: Move atomic into a new sync module

This mirrors the same hierarchy in the standard library.
This commit is contained in:
Alex Crichton 2015-08-17 13:56:55 -07:00
parent 8cb4d8671a
commit 0c849de1a2
5 changed files with 19 additions and 4 deletions

View file

@ -71,8 +71,8 @@
use boxed::Box;
use core::atomic;
use core::atomic::Ordering::{Relaxed, Release, Acquire, SeqCst};
use core::sync::atomic;
use core::sync::atomic::Ordering::{Relaxed, Release, Acquire, SeqCst};
use core::fmt;
use core::cmp::Ordering;
use core::mem::{align_of_val, size_of_val};

View file

@ -142,7 +142,7 @@ pub mod convert;
pub mod any;
pub mod array;
pub mod atomic;
pub mod sync;
pub mod cell;
pub mod char;
pub mod panicking;

15
src/libcore/sync/mod.rs Normal file
View file

@ -0,0 +1,15 @@
// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
//! Synchronization primitives
#![stable(feature = "rust1", since = "1.0.0")]
pub mod atomic;

View file

@ -18,7 +18,7 @@
#![stable(feature = "rust1", since = "1.0.0")]
pub use alloc::arc::{Arc, Weak};
pub use core::atomic;
pub use core::sync::atomic;
pub use self::barrier::{Barrier, BarrierWaitResult};
pub use self::condvar::{Condvar, StaticCondvar, CONDVAR_INIT};