From 985acfdb67d550d0259fcdcfbeed0a86ec3da9d0 Mon Sep 17 00:00:00 2001 From: Aaron Turon Date: Sun, 23 Nov 2014 12:52:37 -0800 Subject: [PATCH] Merge libsync into libstd This patch merges the `libsync` crate into `libstd`, undoing part of the facade. This is in preparation for ultimately merging `librustrt`, as well as the upcoming rewrite of `sync`. Because this removes the `libsync` crate, it is a: [breaking-change] However, all uses of `libsync` should be able to reroute through `std::sync` and `std::comm` instead. --- mk/crates.mk | 5 +- src/etc/licenseck.py | 7 +- src/{libsync => libstd}/comm/mod.rs | 13 ++-- src/{libsync => libstd}/comm/oneshot.rs | 2 +- src/{libsync => libstd}/comm/select.rs | 4 +- src/{libsync => libstd}/comm/shared.rs | 4 +- src/{libsync => libstd}/comm/stream.rs | 4 +- src/{libsync => libstd}/comm/sync.rs | 4 +- src/libstd/lib.rs | 4 +- src/{libsync => libstd/sync}/atomic.rs | 2 +- src/{libsync => libstd/sync}/deque.rs | 18 ++--- src/{libsync => libstd/sync}/lock.rs | 18 ++--- src/libstd/sync/mod.rs | 38 +++++++-- .../sync}/mpmc_bounded_queue.rs | 6 +- src/{libsync => libstd/sync}/mpsc_queue.rs | 4 +- src/{libsync => libstd/sync}/mutex.rs | 10 +-- src/{libsync => libstd/sync}/one.rs | 10 +-- src/{libsync => libstd/sync}/raw.rs | 27 ++++--- src/{libsync => libstd/sync}/spsc_queue.rs | 4 +- src/libsync/lib.rs | 78 ------------------- 20 files changed, 103 insertions(+), 159 deletions(-) rename src/{libsync => libstd}/comm/mod.rs (99%) rename src/{libsync => libstd}/comm/oneshot.rs (99%) rename src/{libsync => libstd}/comm/select.rs (99%) rename src/{libsync => libstd}/comm/shared.rs (99%) rename src/{libsync => libstd}/comm/stream.rs (99%) rename src/{libsync => libstd}/comm/sync.rs (99%) rename src/{libsync => libstd/sync}/atomic.rs (99%) rename src/{libsync => libstd/sync}/deque.rs (98%) rename src/{libsync => libstd/sync}/lock.rs (99%) rename src/{libsync => libstd/sync}/mpmc_bounded_queue.rs (98%) rename src/{libsync => libstd/sync}/mpsc_queue.rs (98%) rename src/{libsync => libstd/sync}/mutex.rs (97%) rename src/{libsync => libstd/sync}/one.rs (97%) rename src/{libsync => libstd/sync}/raw.rs (99%) rename src/{libsync => libstd/sync}/spsc_queue.rs (99%) delete mode 100644 src/libsync/lib.rs diff --git a/mk/crates.mk b/mk/crates.mk index 012b43a2b00..77cea02f43b 100644 --- a/mk/crates.mk +++ b/mk/crates.mk @@ -50,7 +50,7 @@ ################################################################################ TARGET_CRATES := libc std flate arena term \ - serialize sync getopts collections test time rand \ + serialize getopts collections test time rand \ log regex graphviz core rbml alloc rustrt \ unicode HOST_CRATES := syntax rustc rustc_trans rustdoc regex_macros fmt_macros \ @@ -63,7 +63,7 @@ DEPS_libc := core DEPS_unicode := core DEPS_alloc := core libc native:jemalloc DEPS_rustrt := alloc core libc collections native:rustrt_native -DEPS_std := core libc rand alloc collections rustrt sync unicode \ +DEPS_std := core libc rand alloc collections rustrt unicode \ native:rust_builtin native:backtrace DEPS_graphviz := std DEPS_syntax := std term serialize log fmt_macros arena libc @@ -81,7 +81,6 @@ DEPS_glob := std DEPS_serialize := std log DEPS_rbml := std log serialize DEPS_term := std log -DEPS_sync := core alloc rustrt collections DEPS_getopts := std DEPS_collections := core alloc unicode DEPS_num := std diff --git a/src/etc/licenseck.py b/src/etc/licenseck.py index 969ffe0dfe5..9162edcb530 100644 --- a/src/etc/licenseck.py +++ b/src/etc/licenseck.py @@ -38,10 +38,9 @@ exceptions = [ "rt/isaac/randport.cpp", # public domain "rt/isaac/rand.h", # public domain "rt/isaac/standard.h", # public domain - "libsync/mpsc_queue.rs", # BSD - "libsync/spsc_queue.rs", # BSD - "libsync/mpmc_bounded_queue.rs", # BSD - "libsync/mpsc_intrusive.rs", # BSD + "libstd/sync/mpsc_queue.rs", # BSD + "libstd/sync/spsc_queue.rs", # BSD + "libstd/sync/mpmc_bounded_queue.rs", # BSD "test/bench/shootout-binarytrees.rs", # BSD "test/bench/shootout-chameneos-redux.rs", # BSD "test/bench/shootout-fannkuch-redux.rs", # BSD diff --git a/src/libsync/comm/mod.rs b/src/libstd/comm/mod.rs similarity index 99% rename from src/libsync/comm/mod.rs rename to src/libstd/comm/mod.rs index 3c7e46036d6..2b66e91c00d 100644 --- a/src/libsync/comm/mod.rs +++ b/src/libstd/comm/mod.rs @@ -338,12 +338,11 @@ mod $name { extern crate rustrt; - use std::prelude::*; + use prelude::*; use comm::*; use super::*; - use super::super::*; - use std::task; + use task; $(#[$a])* #[test] fn f() { $b } } @@ -1019,9 +1018,9 @@ fn drop(&mut self) { #[cfg(test)] mod test { - use std::prelude::*; + use prelude::*; - use std::os; + use os; use super::*; pub fn stress_factor() -> uint { @@ -1554,8 +1553,8 @@ fn recv(rx: Receiver>, i: int) { #[cfg(test)] mod sync_tests { - use std::prelude::*; - use std::os; + use prelude::*; + use os; pub fn stress_factor() -> uint { match os::getenv("RUST_TEST_STRESS") { diff --git a/src/libsync/comm/oneshot.rs b/src/libstd/comm/oneshot.rs similarity index 99% rename from src/libsync/comm/oneshot.rs rename to src/libstd/comm/oneshot.rs index 5d3c59e8a79..bc34c3e8c52 100644 --- a/src/libsync/comm/oneshot.rs +++ b/src/libstd/comm/oneshot.rs @@ -44,7 +44,7 @@ use rustrt::local::Local; use rustrt::task::{Task, BlockedTask}; -use atomic; +use sync::atomic; use comm::Receiver; // Various states you can find a port in. diff --git a/src/libsync/comm/select.rs b/src/libstd/comm/select.rs similarity index 99% rename from src/libsync/comm/select.rs rename to src/libstd/comm/select.rs index f8266643084..621556f75ce 100644 --- a/src/libsync/comm/select.rs +++ b/src/libstd/comm/select.rs @@ -325,9 +325,9 @@ fn next(&mut self) -> Option<*mut Handle<'static, ()>> { #[cfg(test)] #[allow(unused_imports)] mod test { - use std::prelude::*; + use prelude::*; - use super::super::*; + use super::*; // Don't use the libstd version so we can pull in the right Select structure // (std::comm points at the wrong one) diff --git a/src/libsync/comm/shared.rs b/src/libstd/comm/shared.rs similarity index 99% rename from src/libsync/comm/shared.rs rename to src/libstd/comm/shared.rs index 96c0acacd80..6396edbdbd1 100644 --- a/src/libsync/comm/shared.rs +++ b/src/libstd/comm/shared.rs @@ -30,8 +30,8 @@ use rustrt::task::{Task, BlockedTask}; use rustrt::thread::Thread; -use atomic; -use mpsc_queue as mpsc; +use sync::atomic; +use sync::mpsc_queue as mpsc; const DISCONNECTED: int = int::MIN; const FUDGE: int = 1024; diff --git a/src/libsync/comm/stream.rs b/src/libstd/comm/stream.rs similarity index 99% rename from src/libsync/comm/stream.rs rename to src/libstd/comm/stream.rs index 67878e3ba5a..23d042960b1 100644 --- a/src/libsync/comm/stream.rs +++ b/src/libstd/comm/stream.rs @@ -31,9 +31,9 @@ use rustrt::task::{Task, BlockedTask}; use rustrt::thread::Thread; -use atomic; +use sync::atomic; +use sync::spsc_queue as spsc; use comm::Receiver; -use spsc_queue as spsc; const DISCONNECTED: int = int::MIN; #[cfg(test)] diff --git a/src/libsync/comm/sync.rs b/src/libstd/comm/sync.rs similarity index 99% rename from src/libsync/comm/sync.rs rename to src/libstd/comm/sync.rs index 27b943624d7..a2e839e134c 100644 --- a/src/libsync/comm/sync.rs +++ b/src/libstd/comm/sync.rs @@ -39,14 +39,14 @@ use self::Blocker::*; use alloc::boxed::Box; -use collections::Vec; +use vec::Vec; use core::mem; use core::cell::UnsafeCell; use rustrt::local::Local; use rustrt::mutex::{NativeMutex, LockGuard}; use rustrt::task::{Task, BlockedTask}; -use atomic; +use sync::atomic; pub struct Packet { /// Only field outside of the mutex. Just done for kicks, but mainly because diff --git a/src/libstd/lib.rs b/src/libstd/lib.rs index 77da727e94d..80249808546 100644 --- a/src/libstd/lib.rs +++ b/src/libstd/lib.rs @@ -124,7 +124,6 @@ extern crate core; extern crate "collections" as core_collections; extern crate "rand" as core_rand; -extern crate "sync" as core_sync; extern crate libc; extern crate rustrt; @@ -173,8 +172,6 @@ pub use unicode::char; -pub use core_sync::comm; - /* Exported macros */ pub mod macros; @@ -236,6 +233,7 @@ pub mod task; pub mod sync; +pub mod comm; #[cfg(unix)] #[path = "sys/unix/mod.rs"] mod sys; diff --git a/src/libsync/atomic.rs b/src/libstd/sync/atomic.rs similarity index 99% rename from src/libsync/atomic.rs rename to src/libstd/sync/atomic.rs index 0bc5dd11c25..2bb55188113 100644 --- a/src/libsync/atomic.rs +++ b/src/libstd/sync/atomic.rs @@ -178,7 +178,7 @@ fn drop(&mut self) { #[cfg(test)] mod test { - use std::prelude::*; + use prelude::*; use super::*; #[test] diff --git a/src/libsync/deque.rs b/src/libstd/sync/deque.rs similarity index 98% rename from src/libsync/deque.rs rename to src/libstd/sync/deque.rs index 1fece03b273..33f6f77eb62 100644 --- a/src/libsync/deque.rs +++ b/src/libstd/sync/deque.rs @@ -57,13 +57,13 @@ use alloc::arc::Arc; use alloc::heap::{allocate, deallocate}; use alloc::boxed::Box; -use collections::Vec; +use vec::Vec; use core::kinds::marker; use core::mem::{forget, min_align_of, size_of, transmute}; use core::ptr; use rustrt::exclusive::Exclusive; -use atomic::{AtomicInt, AtomicPtr, SeqCst}; +use sync::atomic::{AtomicInt, AtomicPtr, SeqCst}; // Once the queue is less than 1/K full, then it will be downsized. Note that // the deque requires that this number be less than 2. @@ -410,16 +410,16 @@ fn drop(&mut self) { #[cfg(test)] mod tests { - use std::prelude::*; + use prelude::*; use super::{Data, BufferPool, Abort, Empty, Worker, Stealer}; - use std::mem; + use mem; use rustrt::thread::Thread; - use std::rand; - use std::rand::Rng; - use atomic::{AtomicBool, INIT_ATOMIC_BOOL, SeqCst, - AtomicUint, INIT_ATOMIC_UINT}; - use std::vec; + use rand; + use rand::Rng; + use sync::atomic::{AtomicBool, INIT_ATOMIC_BOOL, SeqCst, + AtomicUint, INIT_ATOMIC_UINT}; + use vec; #[test] fn smoke() { diff --git a/src/libsync/lock.rs b/src/libstd/sync/lock.rs similarity index 99% rename from src/libsync/lock.rs rename to src/libstd/sync/lock.rs index d6378c2190e..6b63f7ae618 100644 --- a/src/libsync/lock.rs +++ b/src/libstd/sync/lock.rs @@ -27,7 +27,7 @@ use rustrt::local::Local; use rustrt::task::Task; -use raw; +use super::raw; /**************************************************************************** * Poisoning helpers @@ -158,7 +158,7 @@ pub fn broadcast_on(&self, condvar_id: uint) -> uint { /// # Example /// /// ``` -/// use sync::{Mutex, Arc}; +/// use std::sync::{Mutex, Arc}; /// /// let mutex = Arc::new(Mutex::new(1i)); /// let mutex2 = mutex.clone(); @@ -259,7 +259,7 @@ fn deref_mut<'a>(&'a mut self) -> &'a mut T { &mut *self._data } /// # Example /// /// ``` -/// use sync::{RWLock, Arc}; +/// use std::sync::{RWLock, Arc}; /// /// let lock1 = Arc::new(RWLock::new(1i)); /// let lock2 = lock1.clone(); @@ -395,7 +395,7 @@ fn deref_mut<'a>(&'a mut self) -> &'a mut T { &mut *self._data } /// of some computation. /// /// ```rust -/// use sync::{Arc, Barrier}; +/// use std::sync::{Arc, Barrier}; /// /// let barrier = Arc::new(Barrier::new(10)); /// for _ in range(0u, 10) { @@ -458,12 +458,12 @@ pub fn wait(&self) { #[cfg(test)] mod tests { - use std::prelude::*; - use std::comm::Empty; - use std::task; - use std::task::try_future; + use prelude::*; + use comm::Empty; + use task; + use task::try_future; + use sync::Arc; - use Arc; use super::{Mutex, Barrier, RWLock}; #[test] diff --git a/src/libstd/sync/mod.rs b/src/libstd/sync/mod.rs index 38e1e952f77..944b852db35 100644 --- a/src/libstd/sync/mod.rs +++ b/src/libstd/sync/mod.rs @@ -17,17 +17,41 @@ #![experimental] -#[stable] -pub use core_sync::atomic; +pub use self::one::{Once, ONCE_INIT}; -pub use core_sync::{deque, mpmc_bounded_queue, mpsc_queue, spsc_queue}; -pub use core_sync::{Arc, Weak, Mutex, MutexGuard, Condvar, Barrier}; -pub use core_sync::{RWLock, RWLockReadGuard, RWLockWriteGuard}; -pub use core_sync::{Semaphore, SemaphoreGuard}; -pub use core_sync::one::{Once, ONCE_INIT}; +pub use alloc::arc::{Arc, Weak}; +pub use self::lock::{Mutex, MutexGuard, Condvar, Barrier, + RWLock, RWLockReadGuard, RWLockWriteGuard}; + +// The mutex/rwlock in this module are not meant for reexport +pub use self::raw::{Semaphore, SemaphoreGuard}; pub use self::future::Future; pub use self::task_pool::TaskPool; +// Core building blocks for all primitives in this crate + +#[stable] +pub mod atomic; + +// Concurrent data structures + +pub mod spsc_queue; +pub mod mpsc_queue; +pub mod mpmc_bounded_queue; +pub mod deque; + +// Low-level concurrency primitives + +mod raw; +mod mutex; +mod one; + +// Higher level primitives based on those above + +mod lock; + +// Task management + mod future; mod task_pool; diff --git a/src/libsync/mpmc_bounded_queue.rs b/src/libstd/sync/mpmc_bounded_queue.rs similarity index 98% rename from src/libsync/mpmc_bounded_queue.rs rename to src/libstd/sync/mpmc_bounded_queue.rs index 4414f710b15..dca2d4098c6 100644 --- a/src/libsync/mpmc_bounded_queue.rs +++ b/src/libstd/sync/mpmc_bounded_queue.rs @@ -33,11 +33,11 @@ use core::prelude::*; use alloc::arc::Arc; -use collections::Vec; +use vec::Vec; use core::num::UnsignedInt; use core::cell::UnsafeCell; -use atomic::{AtomicUint,Relaxed,Release,Acquire}; +use sync::atomic::{AtomicUint,Relaxed,Release,Acquire}; struct Node { sequence: AtomicUint, @@ -165,7 +165,7 @@ fn clone(&self) -> Queue { #[cfg(test)] mod tests { - use std::prelude::*; + use prelude::*; use super::Queue; #[test] diff --git a/src/libsync/mpsc_queue.rs b/src/libstd/sync/mpsc_queue.rs similarity index 98% rename from src/libsync/mpsc_queue.rs rename to src/libstd/sync/mpsc_queue.rs index 63379ad1d9d..09212e4dfb6 100644 --- a/src/libsync/mpsc_queue.rs +++ b/src/libstd/sync/mpsc_queue.rs @@ -48,7 +48,7 @@ use core::mem; use core::cell::UnsafeCell; -use atomic::{AtomicPtr, Release, Acquire, AcqRel, Relaxed}; +use sync::atomic::{AtomicPtr, Release, Acquire, AcqRel, Relaxed}; /// A result of the `pop` function. pub enum PopResult { @@ -159,7 +159,7 @@ fn drop(&mut self) { #[cfg(test)] mod tests { - use std::prelude::*; + use prelude::*; use alloc::arc::Arc; diff --git a/src/libsync/mutex.rs b/src/libstd/sync/mutex.rs similarity index 97% rename from src/libsync/mutex.rs rename to src/libstd/sync/mutex.rs index 365609695ff..c9e90210c30 100644 --- a/src/libsync/mutex.rs +++ b/src/libstd/sync/mutex.rs @@ -28,8 +28,8 @@ /// /// # Example /// -/// ```rust -/// use sync::mutex::Mutex; +/// ```rust,ignore +/// use std::sync::mutex::Mutex; /// /// let m = Mutex::new(); /// let guard = m.lock(); @@ -57,8 +57,8 @@ pub struct Mutex { /// /// # Example /// -/// ```rust -/// use sync::mutex::{StaticMutex, MUTEX_INIT}; +/// ```rust,ignore +/// use std::sync::mutex::{StaticMutex, MUTEX_INIT}; /// /// static LOCK: StaticMutex = MUTEX_INIT; /// @@ -156,7 +156,7 @@ fn drop(&mut self) { #[cfg(test)] mod test { - use std::prelude::*; + use prelude::*; use super::{Mutex, StaticMutex, MUTEX_INIT}; #[test] diff --git a/src/libsync/one.rs b/src/libstd/sync/one.rs similarity index 97% rename from src/libsync/one.rs rename to src/libstd/sync/one.rs index 62b37660912..f710a6da59b 100644 --- a/src/libsync/one.rs +++ b/src/libstd/sync/one.rs @@ -18,7 +18,7 @@ use core::int; use core::atomic; -use mutex::{StaticMutex, MUTEX_INIT}; +use super::mutex::{StaticMutex, MUTEX_INIT}; /// A synchronization primitive which can be used to run a one-time global /// initialization. Useful for one-time initialization for FFI or related @@ -27,8 +27,8 @@ /// /// # Example /// -/// ```rust -/// use sync::one::{Once, ONCE_INIT}; +/// ```rust,ignore +/// use std::sync::one::{Once, ONCE_INIT}; /// /// static START: Once = ONCE_INIT; /// @@ -120,8 +120,8 @@ pub fn doit(&self, f: ||) { #[cfg(test)] mod test { - use std::prelude::*; - use std::task; + use prelude::*; + use task; use super::{ONCE_INIT, Once}; #[test] diff --git a/src/libsync/raw.rs b/src/libstd/sync/raw.rs similarity index 99% rename from src/libsync/raw.rs rename to src/libstd/sync/raw.rs index 8ab21fe380f..ff3f2c9462c 100644 --- a/src/libsync/raw.rs +++ b/src/libstd/sync/raw.rs @@ -15,6 +15,10 @@ //! `sync` crate which wrap values directly and provide safer abstractions for //! containing data. +// A side-effect of merging libsync into libstd; will go away once +// libsync rewrite lands +#![allow(dead_code)] + use core::prelude::*; use self::ReacquireOrderLock::*; @@ -23,9 +27,9 @@ use core::kinds::marker; use core::mem; use core::cell::UnsafeCell; -use collections::Vec; +use vec::Vec; -use mutex; +use super::mutex; use comm::{Receiver, Sender, channel}; /**************************************************************************** @@ -518,8 +522,8 @@ pub fn read<'a>(&'a self) -> RWLockReadGuard<'a> { /// /// # Example /// - /// ```rust - /// use sync::raw::RWLock; + /// ```{rust,ignore} + /// use std::sync::raw::RWLock; /// /// let lock = RWLock::new(); /// let write = lock.write(); @@ -622,14 +626,13 @@ fn drop(&mut self) { mod tests { pub use self::RWLockMode::*; - use std::prelude::*; - - use Arc; + use sync::Arc; + use prelude::*; use super::{Semaphore, Mutex, RWLock, Condvar}; - use std::mem; - use std::result; - use std::task; + use mem; + use result; + use task; /************************************************************************ * Semaphore tests @@ -837,7 +840,7 @@ fn test_mutex_cond_no_waiter() { } #[test] fn test_mutex_killed_simple() { - use std::any::Any; + use any::Any; // Mutex must get automatically unlocked if panicked/killed within. let m = Arc::new(Mutex::new()); @@ -1077,7 +1080,7 @@ fn test_rwlock_cond_broadcast() { } #[cfg(test)] fn rwlock_kill_helper(mode1: RWLockMode, mode2: RWLockMode) { - use std::any::Any; + use any::Any; // Mutex must get automatically unlocked if panicked/killed within. let x = Arc::new(RWLock::new()); diff --git a/src/libsync/spsc_queue.rs b/src/libstd/sync/spsc_queue.rs similarity index 99% rename from src/libsync/spsc_queue.rs rename to src/libstd/sync/spsc_queue.rs index ef0ceb14145..f0eabe61737 100644 --- a/src/libsync/spsc_queue.rs +++ b/src/libstd/sync/spsc_queue.rs @@ -42,7 +42,7 @@ use core::cell::UnsafeCell; use alloc::arc::Arc; -use atomic::{AtomicPtr, Relaxed, AtomicUint, Acquire, Release}; +use sync::atomic::{AtomicPtr, Relaxed, AtomicUint, Acquire, Release}; // Node within the linked list queue of messages to send struct Node { @@ -294,7 +294,7 @@ fn drop(&mut self) { #[cfg(test)] mod test { - use std::prelude::*; + use prelude::*; use super::{queue}; diff --git a/src/libsync/lib.rs b/src/libsync/lib.rs deleted file mode 100644 index 9d6f6513a65..00000000000 --- a/src/libsync/lib.rs +++ /dev/null @@ -1,78 +0,0 @@ -// 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 or the MIT license -// , 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_name = "sync"] -#![experimental] -#![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/nightly/", - html_playground_url = "http://play.rust-lang.org/")] - -#![feature(phase, globs, macro_rules, unsafe_destructor)] -#![feature(import_shadowing)] -#![deny(missing_docs)] -#![no_std] - -#[phase(plugin, link)] extern crate core; -extern crate alloc; -extern crate collections; -extern crate rustrt; - -#[cfg(test)] extern crate test; -#[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 atomic; - -// Concurrent data structures - -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}; -}