book icon indicating copy to clipboard operation
book copied to clipboard

Update loop to Result: 10

Open miketon opened this issue 2 years ago • 0 comments
trafficstars

Chapter 16-15 has drift between the book text and the code that this PR tries to address

  1. The current code print output is Result: 9
  2. The text describes that the output should be Result: 10

First time OS contribution attempt lol, so any critique and advice appreciated~

For reference the book text :

Listing 16-15: Using an Arc<T> to wrap the Mutex<T> to be able to share
ownership across multiple threads

This code will print the following:

Result: 10

We did it! We counted from 0 to 10, which may not seem very impressive, but it
did teach us a lot about Mutex<T> and thread safety ...

miketon avatar Jul 19 '23 16:07 miketon