diff options
| author | mo8it <mo8it@proton.me> | 2024-07-01 11:11:11 +0200 |
|---|---|---|
| committer | mo8it <mo8it@proton.me> | 2024-07-01 11:11:11 +0200 |
| commit | dfa2b44f718906dfac54816bb582880066c3dff0 (patch) | |
| tree | 3962116535c457edcaa9828720193afc37883344 /rustlings-macros | |
| parent | b000164eedaf5ada18ce0562aa9b7aed25663458 (diff) | |
threads2 solution
Diffstat (limited to 'rustlings-macros')
| -rw-r--r-- | rustlings-macros/info.toml | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/rustlings-macros/info.toml b/rustlings-macros/info.toml index 37afa17..ab8c121 100644 --- a/rustlings-macros/info.toml +++ b/rustlings-macros/info.toml @@ -1051,19 +1051,19 @@ dir = "20_threads" test = false hint = """ `Arc` is an Atomic Reference Counted pointer that allows safe, shared access -to **immutable** data. But we want to *change* the number of `jobs_completed` -so we'll need to also use another type that will only allow one thread to -mutate the data at a time. Take a look at this section of the book: +to **immutable** data. But we want to *change* the number of `jobs_done` so +we'll need to also use another type that will only allow one thread to mutate +the data at a time. Take a look at this section of the book: https://doc.rust-lang.org/book/ch16-03-shared-state.html#atomic-reference-counting-with-arct Keep reading if you'd like more hints :) Do you now have an `Arc<Mutex<JobStatus>>` at the beginning of `main`? Like: ``` -let status = Arc::new(Mutex::new(JobStatus { jobs_completed: 0 })); +let status = Arc::new(Mutex::new(JobStatus { jobs_done: 0 })); ``` -Similar to the code in the following example in the book: +Similar to the code in the following example in The Book: https://doc.rust-lang.org/book/ch16-03-shared-state.html#sharing-a-mutext-between-multiple-threads""" [[exercises]] |
