File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -614,6 +614,30 @@ impl<T> JoinInner<T> {
614
614
/// This `struct` is created by the [`thread::spawn`] function and the
615
615
/// [`thread::Builder::spawn`] method.
616
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
+ ///
617
641
/// [`thread::spawn`]: fn.spawn.html
618
642
/// [`thread::Builder::spawn`]: struct.Builder.html#method.spawn
619
643
#[ stable( feature = "rust1" , since = "1.0.0" ) ]
You can’t perform that action at this time.
0 commit comments