diff options
| author | Corey Farwell <coreyf@rwell.org> | 2017-08-02 20:59:33 -0400 |
|---|---|---|
| committer | Corey Farwell <coreyf@rwell.org> | 2017-08-02 23:16:34 -0400 |
| commit | 4c08c131fa6ef63809f6a4eb25ae1289dd381259 (patch) | |
| tree | 7aa9a7c8dac5d1d8546058a205e41491fb308621 /src/libstd/thread | |
| parent | 795db4c946a5093877b50a59f0575e58103fec0f (diff) | |
| download | rust-4c08c131fa6ef63809f6a4eb25ae1289dd381259.tar.gz rust-4c08c131fa6ef63809f6a4eb25ae1289dd381259.zip | |
Indicate how `ThreadId` is created.
Diffstat (limited to 'src/libstd/thread')
| -rw-r--r-- | src/libstd/thread/mod.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/libstd/thread/mod.rs b/src/libstd/thread/mod.rs index c1d9a0c9e6b..cbd019c2c0e 100644 --- a/src/libstd/thread/mod.rs +++ b/src/libstd/thread/mod.rs @@ -820,7 +820,8 @@ pub fn park_timeout(dur: Duration) { /// /// A `ThreadId` is an opaque object that has a unique value for each thread /// that creates one. `ThreadId`s are not guaranteed to correspond to a thread's -/// system-designated identifier. +/// system-designated identifier. A `ThreadId` can be retrieved from the [`id`] +/// method on a [`Thread`]. /// /// # Examples /// @@ -834,6 +835,9 @@ pub fn park_timeout(dur: Duration) { /// let other_thread_id = other_thread.join().unwrap(); /// assert!(thread::current().id() != other_thread_id); /// ``` +/// +/// [`id`]: ../../std/thread/struct.Thread.html#method.id +/// [`Thread`]: ../../std/thread/struct.Thread.html #[stable(feature = "thread_id", since = "1.19.0")] #[derive(Eq, PartialEq, Clone, Copy, Hash, Debug)] pub struct ThreadId(u64); |
