File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -623,6 +623,36 @@ impl<T> JoinInner<T> {
623623/// Due to platform restrictions, it is not possible to `Clone` this
624624/// handle: the ability to join a child thread is a uniquely-owned
625625/// permission.
626+ ///
627+ /// This `struct` is created by the [`thread::spawn`] function and the
628+ /// [`thread::Builder::spawn`] method.
629+ ///
630+ /// # Examples
631+ ///
632+ /// Creation from [`thread::spawn`]:
633+ ///
634+ /// ```rust
635+ /// use std::thread;
636+ ///
637+ /// let join_handle: thread::JoinHandle<_> = thread::spawn(|| {
638+ /// // some work here
639+ /// });
640+ /// ```
641+ ///
642+ /// Creation from [`thread::Builder::spawn`]:
643+ ///
644+ /// ```rust
645+ /// use std::thread;
646+ ///
647+ /// let builder = thread::Builder::new();
648+ ///
649+ /// let join_handle: thread::JoinHandle<_> = builder.spawn(|| {
650+ /// // some work here
651+ /// }).unwrap();
652+ /// ```
653+ ///
654+ /// [`thread::spawn`]: fn.spawn.html
655+ /// [`thread::Builder::spawn`]: struct.Builder.html#method.spawn
626656#[ stable( feature = "rust1" , since = "1.0.0" ) ]
627657pub struct JoinHandle < T > ( JoinInner < T > ) ;
628658
You can’t perform that action at this time.
0 commit comments