Navigation Menu

Skip to content

Commit

Permalink
Indicate how ThreadId is created.
Browse files Browse the repository at this point in the history
  • Loading branch information
frewsxcv committed Aug 3, 2017
1 parent 795db4c commit 4c08c13
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/libstd/thread/mod.rs
Expand Up @@ -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
///
Expand All @@ -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);
Expand Down

0 comments on commit 4c08c13

Please sign in to comment.