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.
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 //! Core concurrency-enabled mechanisms and primitives.
13 //! This crate contains the implementations of Rust's core synchronization
14 //! primitives. This includes channels, mutexes, condition variables, etc.
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`.
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)]
34 #[phase(syntax, link)] extern crate core;
36 #[phase(plugin, link)] extern crate core;
38 extern crate collections;
41 #[cfg(test)] extern crate test;
42 #[cfg(test)] extern crate native;
43 #[cfg(test, stage0)] #[phase(syntax, link)] extern crate std;
44 #[cfg(test, not(stage0))] #[phase(plugin, link)] extern crate std;
46 pub use alloc::arc::{Arc, Weak};
47 pub use lock::{Mutex, MutexGuard, Condvar, Barrier,
48 RWLock, RWLockReadGuard, RWLockWriteGuard};
50 // The mutex/rwlock in this module are not meant for reexport
51 pub use raw::{Semaphore, SemaphoreGuard};
53 // Core building blocks for all primitives in this crate
57 // Concurrent data structures
62 pub mod mpmc_bounded_queue;
65 // Low-level concurrency primitives
71 // Message-passing based communication
75 // Higher level primitives based on those above
81 pub use core::{fmt, option, cmp, clone};