]> git.lizzy.rs Git - rust.git/blob - src/libsync/lib.rs
Register new snapshots
[rust.git] / src / libsync / lib.rs
1 // Copyright 2012-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
11 //! Core concurrency-enabled mechanisms and primitives.
12 //!
13 //! This crate contains the implementations of Rust's core synchronization
14 //! primitives. This includes channels, mutexes, condition variables, etc.
15 //!
16 //! The interface of this crate is experimental, and it is not recommended to
17 //! use this crate specifically. Instead, its functionality is reexported
18 //! through `std::sync`.
19
20 #![crate_id = "sync#0.11.0-pre"]
21 #![crate_type = "rlib"]
22 #![crate_type = "dylib"]
23 #![license = "MIT/ASL2"]
24 #![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
25        html_favicon_url = "http://www.rust-lang.org/favicon.ico",
26        html_root_url = "http://doc.rust-lang.org/",
27        html_playground_url = "http://play.rust-lang.org/")]
28 #![feature(phase, globs, macro_rules)]
29
30 #![deny(missing_doc)]
31 #![no_std]
32
33 #[phase(plugin, link)] extern crate core;
34 extern crate alloc;
35 extern crate collections;
36 extern crate rustrt;
37
38 #[cfg(test)] extern crate test;
39 #[cfg(test)] extern crate native;
40 #[cfg(test)] #[phase(plugin, link)] extern crate std;
41
42 pub use alloc::arc::{Arc, Weak};
43 pub use lock::{Mutex, MutexGuard, Condvar, Barrier,
44                RWLock, RWLockReadGuard, RWLockWriteGuard};
45
46 // The mutex/rwlock in this module are not meant for reexport
47 pub use raw::{Semaphore, SemaphoreGuard};
48
49 // Core building blocks for all primitives in this crate
50
51 pub mod atomics;
52
53 // Concurrent data structures
54
55 mod mpsc_intrusive;
56 pub mod spsc_queue;
57 pub mod mpsc_queue;
58 pub mod mpmc_bounded_queue;
59 pub mod deque;
60
61 // Low-level concurrency primitives
62
63 pub mod raw;
64 pub mod mutex;
65 pub mod one;
66
67 // Message-passing based communication
68
69 pub mod comm;
70
71 // Higher level primitives based on those above
72
73 mod lock;
74
75 #[cfg(not(test))]
76 mod std {
77     pub use core::{fmt, option, cmp, clone};
78 }