diff options
| author | bors <bors@rust-lang.org> | 2016-05-07 12:36:18 -0700 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2016-05-07 12:36:18 -0700 |
| commit | d91f8ab0f58fa123857d96b9e151fc5185f5ff08 (patch) | |
| tree | 4a21bdfb7f514938fb2996d83ac0b97b544464ab /src/libstd/thread | |
| parent | 936b32a514b73c1d3dfcbd9d17818f9f18bf4883 (diff) | |
| parent | 84e27738effd0c44f0dc480753fc0affa56fd4a4 (diff) | |
| download | rust-d91f8ab0f58fa123857d96b9e151fc5185f5ff08.tar.gz rust-d91f8ab0f58fa123857d96b9e151fc5185f5ff08.zip | |
Auto merge of #33487 - steveklabnik:rollup, r=steveklabnik
Rollup of 20 pull requests - Successful merges: #33256, #33283, #33313, #33314, #33326, #33336, #33382, #33384, #33402, #33409, #33410, #33412, #33428, #33430, #33437, #33438, #33439, #33442, #33456, #33459 - Failed merges:
Diffstat (limited to 'src/libstd/thread')
| -rw-r--r-- | src/libstd/thread/mod.rs | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/src/libstd/thread/mod.rs b/src/libstd/thread/mod.rs index b3549dc1264..2f0dec759b3 100644 --- a/src/libstd/thread/mod.rs +++ b/src/libstd/thread/mod.rs @@ -13,7 +13,8 @@ //! ## The threading model //! //! An executing Rust program consists of a collection of native OS threads, -//! each with their own stack and local state. +//! each with their own stack and local state. Threads can be named, and +//! provide some built-in support for low-level synchronization. //! //! Communication between threads can be done through //! [channels](../../std/sync/mpsc/index.html), Rust's message-passing @@ -37,20 +38,6 @@ //! convenient facilities for automatically waiting for the termination of a //! child thread (i.e., join). //! -//! ## The `Thread` type -//! -//! Threads are represented via the `Thread` type, which you can -//! get in one of two ways: -//! -//! * By spawning a new thread, e.g. using the `thread::spawn` function. -//! * By requesting the current thread, using the `thread::current` function. -//! -//! Threads can be named, and provide some built-in support for low-level -//! synchronization (described below). -//! -//! The `thread::current()` function is available even for threads not spawned -//! by the APIs of this module. -//! //! ## Spawning a thread //! //! A new thread can be spawned using the `thread::spawn` function: @@ -99,6 +86,18 @@ //! }); //! ``` //! +//! ## The `Thread` type +//! +//! Threads are represented via the `Thread` type, which you can get in one of +//! two ways: +//! +//! * By spawning a new thread, e.g. using the `thread::spawn` function, and +//! calling `thread()` on the `JoinHandle`. +//! * By requesting the current thread, using the `thread::current` function. +//! +//! The `thread::current()` function is available even for threads not spawned +//! by the APIs of this module. +//! //! ## Blocking support: park and unpark //! //! Every thread is equipped with some basic low-level blocking support, via the |
