Skip to content

Commit 4c08c13

Browse files
committed
Indicate how ThreadId is created.
1 parent 795db4c commit 4c08c13

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/libstd/thread/mod.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -820,7 +820,8 @@ pub fn park_timeout(dur: Duration) {
820820
///
821821
/// A `ThreadId` is an opaque object that has a unique value for each thread
822822
/// that creates one. `ThreadId`s are not guaranteed to correspond to a thread's
823-
/// system-designated identifier.
823+
/// system-designated identifier. A `ThreadId` can be retrieved from the [`id`]
824+
/// method on a [`Thread`].
824825
///
825826
/// # Examples
826827
///
@@ -834,6 +835,9 @@ pub fn park_timeout(dur: Duration) {
834835
/// let other_thread_id = other_thread.join().unwrap();
835836
/// assert!(thread::current().id() != other_thread_id);
836837
/// ```
838+
///
839+
/// [`id`]: ../../std/thread/struct.Thread.html#method.id
840+
/// [`Thread`]: ../../std/thread/struct.Thread.html
837841
#[stable(feature = "thread_id", since = "1.19.0")]
838842
#[derive(Eq, PartialEq, Clone, Copy, Hash, Debug)]
839843
pub struct ThreadId(u64);

0 commit comments

Comments
 (0)