diff options
| author | bors <bors@rust-lang.org> | 2014-03-24 18:11:51 -0700 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2014-03-24 18:11:51 -0700 |
| commit | 6bf3fca8ff90bbeff8d5c437aa784d0dbf8f9455 (patch) | |
| tree | 7fe1f4e9c71ec942f54defdd4b1be123f212804f /src/libsync/lib.rs | |
| parent | bcaaffbe1e1c6a6a3abdabdb4fdaef36358dae33 (diff) | |
| parent | 218461d01049242e3544337055b7f6d06943344b (diff) | |
| download | rust-6bf3fca8ff90bbeff8d5c437aa784d0dbf8f9455.tar.gz rust-6bf3fca8ff90bbeff8d5c437aa784d0dbf8f9455.zip | |
auto merge of #12900 : alexcrichton/rust/rewrite-sync, r=brson
* Remove clone-ability from all primitives. All shared state will now come
from the usage of the primitives being shared, not the primitives being
inherently shareable. This allows for fewer allocations for stack-allocated
primitives.
* Add `Mutex<T>` and `RWLock<T>` which are stack-allocated primitives for purely
wrapping a piece of data
* Remove `RWArc<T>` in favor of `Arc<RWLock<T>>`
* Remove `MutexArc<T>` in favor of `Arc<Mutex<T>>`
* Shuffle around where things are located
* The `arc` module now only contains `Arc`
* A new `lock` module contains `Mutex`, `RWLock`, and `Barrier`
* A new `raw` module contains the primitive implementations of `Semaphore`,
`Mutex`, and `RWLock`
* The Deref/DerefMut trait was implemented where appropriate
* `CowArc` was removed, the functionality is now part of `Arc` and is tagged
with `#[experimental]`.
* The crate now has #[deny(missing_doc)]
* `Arc` now supports weak pointers
This is not a large-scale rewrite of the functionality contained within the
`sync` crate, but rather a shuffling of who does what an a thinner hierarchy of
ownership to allow for better composability.
Diffstat (limited to 'src/libsync/lib.rs')
| -rw-r--r-- | src/libsync/lib.rs | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/src/libsync/lib.rs b/src/libsync/lib.rs index 70874a029ac..d166076e96e 100644 --- a/src/libsync/lib.rs +++ b/src/libsync/lib.rs @@ -20,18 +20,28 @@ html_favicon_url = "http://www.rust-lang.org/favicon.ico", html_root_url = "http://static.rust-lang.org/doc/master")]; #[feature(phase)]; +#[deny(missing_doc, deprecated_owned_vector)]; -#[cfg(test)] #[phase(syntax, link)] extern crate log; +#[cfg(test)] +#[phase(syntax, link)] extern crate log; -pub use arc::{Arc, MutexArc, RWArc, RWWriteMode, RWReadMode, ArcCondvar, CowArc}; -pub use sync::{Mutex, RWLock, Condvar, Semaphore, RWLockWriteMode, - RWLockReadMode, Barrier, one, mutex}; pub use comm::{DuplexStream, SyncSender, SyncReceiver, rendezvous, duplex}; pub use task_pool::TaskPool; pub use future::Future; +pub use 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}; mod arc; -mod sync; mod comm; -mod task_pool; mod future; +mod lock; +mod mpsc_intrusive; +mod task_pool; + +pub mod raw; +pub mod mutex; +pub mod one; |
