]> git.lizzy.rs Git - rust.git/commitdiff
rollup merge of #21075: iKevinY/intro-changes
authorAlex Crichton <alex@alexcrichton.com>
Thu, 15 Jan 2015 22:11:41 +0000 (14:11 -0800)
committerAlex Crichton <alex@alexcrichton.com>
Thu, 15 Jan 2015 22:11:41 +0000 (14:11 -0800)
- Make punctuation/formatting consistent with the changes made to *The Rust Programming Language* in #20782.
- Use title casing for "Safety and Speed" section.
- Reword some phrases to improve clarity.

1  2 
src/doc/intro.md

index 8d0ccf6ae3d693a376c6ddc14ed9ecbd03206b86,f244119f322ebd04b2e26b7336c85d0ba6d3ca7d..d93b680ae6de704cb83fd73394475fb1681b88e8
@@@ -400,15 -400,14 +400,15 @@@ fn main() 
  }
  ```
  
 -This program creates ten threads, who all print `Hello, world!`. The
 -`spawn` function takes one argument, a closure, indicated by the
 -double bars `||`. (The `move` keyword indicates that the closure takes
 -ownership of any data it uses; we'll have more on the significance of
 -this shortly.) This closure is executed in a new thread created by
 -`spawn`.
 +This program creates ten threads, which all print `Hello, world!`. The `scoped`
 +function takes one argument, a closure, indicated by the double bars `||`. This
 +closure is executed in a new thread created by `scoped`. The method is called
 +`scoped` because it returns a 'join guard', which will automatically join the
 +child thread when it goes out of scope. Because we `collect` these guards into
 +a `Vec<T>`, and that vector goes out of scope at the end of our program, our
 +program will wait for every thread to finish before finishing.
  
- One common form of problem in concurrent programs is a 'data race.'
+ One common form of problem in concurrent programs is a *data race*.
  This occurs when two different threads attempt to access the same
  location in memory in a non-synchronized way, where at least one of
  them is a write. If one thread is attempting to read, and one thread