thread3 comment

This commit is contained in:
palutz 2023-09-27 14:50:09 +01:00
parent 192f5509bb
commit 8f19aa8b36

View File

@ -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 {