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 @@ -610,6 +610,36 @@ impl<T> JoinInner<T> {
610610/// Due to platform restrictions, it is not possible to `Clone` this
611611/// handle: the ability to join a child thread is a uniquely-owned
612612/// permission.
613+ ///
614+ /// This `struct` is created by the [`thread::spawn`] function and the
615+ /// [`thread::Builder::spawn`] method.
616+ ///
617+ /// # Examples
618+ ///
619+ /// Creation from [`thread::spawn`]:
620+ ///
621+ /// ```rust
622+ /// use std::thread;
623+ ///
624+ /// let join_handle: thread::JoinHandle<_> = thread::spawn(|| {
625+ /// // some work here
626+ /// });
627+ /// ```
628+ ///
629+ /// Creation from [`thread::Builder::spawn`]:
630+ ///
631+ /// ```rust
632+ /// use std::thread;
633+ ///
634+ /// let builder = thread::Builder::new();
635+ ///
636+ /// let join_handle: thread::JoinHandle<_> = builder.spawn(|| {
637+ /// // some work here
638+ /// }).unwrap();
639+ /// ```
640+ ///
641+ /// [`thread::spawn`]: fn.spawn.html
642+ /// [`thread::Builder::spawn`]: struct.Builder.html#method.spawn
613643#[ stable( feature = "rust1" , since = "1.0.0" ) ]
614644pub struct JoinHandle < T > ( JoinInner < T > ) ;
615645
You can’t perform that action at this time.
0 commit comments