Commit 5695aea
committed
Rollup merge of #32507 - klingtnet:master, r=steveklabnik
Fix missing console output in `Barrier` example
The `println!` calls in the previous version were never shown (at least
not in the playpen) because the main thread is finished before all the
spawned child threads were synchronized. This commit adds a join for
each thread handle to wait in the main thread until all child threads
are finished.
r? @steveklabnik1 file changed
+7
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
25 | | - | |
| 26 | + | |
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
29 | | - | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
30 | 35 | | |
31 | 36 | | |
32 | 37 | | |
| |||
0 commit comments