1 // Copyright 2013 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
11 //! Useful synchronization primitives
13 //! This module contains useful safe and unsafe synchronization primitives.
14 //! Most of the primitives in this module do not provide any sort of locking
15 //! and/or blocking at all, but rather provide the necessary tools to build
16 //! other types of concurrent primitives.
18 #![stable(feature = "rust1", since = "1.0.0")]
20 #[stable(feature = "rust1", since = "1.0.0")]
21 pub use alloc::arc::{Arc, Weak};
22 #[stable(feature = "rust1", since = "1.0.0")]
23 pub use core::sync::atomic;
25 #[stable(feature = "rust1", since = "1.0.0")]
26 pub use self::barrier::{Barrier, BarrierWaitResult};
27 #[stable(feature = "rust1", since = "1.0.0")]
28 pub use self::condvar::{Condvar, StaticCondvar, WaitTimeoutResult, CONDVAR_INIT};
29 #[stable(feature = "rust1", since = "1.0.0")]
30 pub use self::mutex::MUTEX_INIT;
31 #[stable(feature = "rust1", since = "1.0.0")]
32 pub use self::mutex::{Mutex, MutexGuard, StaticMutex};
33 #[stable(feature = "rust1", since = "1.0.0")]
34 pub use self::once::{Once, ONCE_INIT};
35 #[stable(feature = "rust1", since = "1.0.0")]
36 pub use sys_common::poison::{PoisonError, TryLockError, TryLockResult, LockResult};
37 #[stable(feature = "rust1", since = "1.0.0")]
38 pub use self::rwlock::{RwLockReadGuard, RwLockWriteGuard};
39 #[stable(feature = "rust1", since = "1.0.0")]
40 pub use self::rwlock::{RwLock, StaticRwLock, RW_LOCK_INIT};
41 #[stable(feature = "rust1", since = "1.0.0")]
42 pub use self::semaphore::{Semaphore, SemaphoreGuard};