]> git.proxmox.com Git - rustc.git/blame - src/libstd/sync/mod.rs
New upstream version 1.29.0+dfsg1
[rustc.git] / src / libstd / sync / mod.rs
CommitLineData
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")]
8faf50e0 21pub use alloc_crate::sync::{Arc, Weak};
92a42be0 22#[stable(feature = "rust1", since = "1.0.0")]
e9174d1e 23pub use core::sync::atomic;
1a4d82fc 24
92a42be0 25#[stable(feature = "rust1", since = "1.0.0")]
9346a6ac 26pub use self::barrier::{Barrier, BarrierWaitResult};
92a42be0 27#[stable(feature = "rust1", since = "1.0.0")]
5bcae85e 28pub use self::condvar::{Condvar, WaitTimeoutResult};
92a42be0 29#[stable(feature = "rust1", since = "1.0.0")]
5bcae85e 30pub use self::mutex::{Mutex, MutexGuard};
92a42be0 31#[stable(feature = "rust1", since = "1.0.0")]
a7813a04 32pub use self::once::{Once, OnceState, ONCE_INIT};
92a42be0 33#[stable(feature = "rust1", since = "1.0.0")]
9346a6ac 34pub use sys_common::poison::{PoisonError, TryLockError, TryLockResult, LockResult};
92a42be0 35#[stable(feature = "rust1", since = "1.0.0")]
5bcae85e 36pub use self::rwlock::{RwLock, RwLockReadGuard, RwLockWriteGuard};
1a4d82fc 37
1a4d82fc
JJ
38pub mod mpsc;
39
40mod barrier;
41mod condvar;
1a4d82fc
JJ
42mod mutex;
43mod once;
1a4d82fc 44mod rwlock;