about summary refs log tree commit diff
path: root/src/libsync/lib.rs
blob: 4e8617e48c33988f4ce30ed58c3e671cda855a38 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
// Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.

//! Core concurrency-enabled mechanisms and primitives.
//!
//! This crate contains the implementations of Rust's core synchronization
//! primitives. This includes channels, mutexes, condition variables, etc.
//!
//! The interface of this crate is experimental, and it is not recommended to
//! use this crate specifically. Instead, its functionality is reexported
//! through `std::sync`.

#![crate_id = "sync#0.11.0-pre"]
#![crate_type = "rlib"]
#![crate_type = "dylib"]
#![license = "MIT/ASL2"]
#![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
       html_favicon_url = "http://www.rust-lang.org/favicon.ico",
       html_root_url = "http://doc.rust-lang.org/",
       html_playground_url = "http://play.rust-lang.org/")]
#![feature(phase, globs, macro_rules)]

#![deny(missing_doc)]
#![no_std]

#[phase(plugin, link)] extern crate core;
extern crate alloc;
extern crate collections;
extern crate rustrt;

#[cfg(test)] extern crate test;
#[cfg(test)] extern crate native;
#[cfg(test)] #[phase(plugin, link)] extern crate std;

pub use alloc::arc::{Arc, Weak};
pub use lock::{Mutex, MutexGuard, Condvar, Barrier,
               RWLock, RWLockReadGuard, RWLockWriteGuard};

// The mutex/rwlock in this module are not meant for reexport
pub use raw::{Semaphore, SemaphoreGuard};

// Core building blocks for all primitives in this crate

pub mod atomics;

// Concurrent data structures

mod mpsc_intrusive;
pub mod spsc_queue;
pub mod mpsc_queue;
pub mod mpmc_bounded_queue;
pub mod deque;

// Low-level concurrency primitives

pub mod raw;
pub mod mutex;
pub mod one;

// Message-passing based communication

pub mod comm;

// Higher level primitives based on those above

mod lock;

#[cfg(not(test))]
mod std {
    pub use core::{fmt, option, cmp, clone};
}