Skip to content

Commit 1d2a6df

Browse files
committed
Auto merge of #43619 - frewsxcv:frewsxcv-thread, r=QuietMisdreavus
Thread docs fix and improvements. None
2 parents c701ba6 + 4c08c13 commit 1d2a6df

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/libstd/thread/mod.rs

+8-1
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);
@@ -896,6 +900,9 @@ struct Inner {
896900
/// docs of [`Builder`] and [`spawn`] for more details.
897901
///
898902
/// [`Builder`]: ../../std/thread/struct.Builder.html
903+
/// [`JoinHandle::thread`]: ../../std/thread/struct.JoinHandle.html#method.thread
904+
/// [`JoinHandle`]: ../../std/thread/struct.JoinHandle.html
905+
/// [`thread::current`]: ../../std/thread/fn.current.html
899906
/// [`spawn`]: ../../std/thread/fn.spawn.html
900907
901908
pub struct Thread {

0 commit comments

Comments
 (0)