]>
Commit | Line | Data |
---|---|---|
1a4d82fc JJ |
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. | |
4 | // | |
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. | |
10 | ||
54a0048b | 11 | //! Useful synchronization primitives. |
1a4d82fc JJ |
12 | //! |
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. | |
17 | ||
85aaf69f | 18 | #![stable(feature = "rust1", since = "1.0.0")] |
1a4d82fc | 19 | |
92a42be0 | 20 | #[stable(feature = "rust1", since = "1.0.0")] |
83c7162d | 21 | pub use alloc_crate::arc::{Arc, Weak}; |
92a42be0 | 22 | #[stable(feature = "rust1", since = "1.0.0")] |
e9174d1e | 23 | pub use core::sync::atomic; |
1a4d82fc | 24 | |
92a42be0 | 25 | #[stable(feature = "rust1", since = "1.0.0")] |
9346a6ac | 26 | pub use self::barrier::{Barrier, BarrierWaitResult}; |
92a42be0 | 27 | #[stable(feature = "rust1", since = "1.0.0")] |
5bcae85e | 28 | pub use self::condvar::{Condvar, WaitTimeoutResult}; |
92a42be0 | 29 | #[stable(feature = "rust1", since = "1.0.0")] |
5bcae85e | 30 | pub use self::mutex::{Mutex, MutexGuard}; |
92a42be0 | 31 | #[stable(feature = "rust1", since = "1.0.0")] |
a7813a04 | 32 | pub use self::once::{Once, OnceState, ONCE_INIT}; |
92a42be0 | 33 | #[stable(feature = "rust1", since = "1.0.0")] |
9346a6ac | 34 | pub use sys_common::poison::{PoisonError, TryLockError, TryLockResult, LockResult}; |
92a42be0 | 35 | #[stable(feature = "rust1", since = "1.0.0")] |
5bcae85e | 36 | pub use self::rwlock::{RwLock, RwLockReadGuard, RwLockWriteGuard}; |
1a4d82fc | 37 | |
1a4d82fc JJ |
38 | pub mod mpsc; |
39 | ||
40 | mod barrier; | |
41 | mod condvar; | |
1a4d82fc JJ |
42 | mod mutex; |
43 | mod once; | |
1a4d82fc | 44 | mod rwlock; |