mirror of
https://github.com/rust-lang/rustlings.git
synced 2026-01-08 03:39:18 +00:00
thread3 comment
This commit is contained in:
parent
192f5509bb
commit
8f19aa8b36
@ -3,8 +3,6 @@
|
||||
// Execute `rustlings hint threads3` or use the `hint` watch subcommand for a
|
||||
// hint.
|
||||
|
||||
// I AM NOT DONE
|
||||
|
||||
use std::sync::mpsc;
|
||||
use std::sync::Arc;
|
||||
use std::thread;
|
||||
@ -31,6 +29,7 @@ fn send_tx(q: Queue, tx: mpsc::Sender<u32>) -> () {
|
||||
let qc1 = Arc::clone(&qc);
|
||||
let qc2 = Arc::clone(&qc);
|
||||
|
||||
// need to clone the producer to achieve multiple producers
|
||||
let tx1 = tx.clone();
|
||||
thread::spawn(move || {
|
||||
for val in &qc1.first_half {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user