From 8f19aa8b3682e1ff6a7bcdb346cdf3e68c822e93 Mon Sep 17 00:00:00 2001 From: palutz <> Date: Wed, 27 Sep 2023 14:50:09 +0100 Subject: [PATCH] thread3 comment --- exercises/threads/threads3.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/exercises/threads/threads3.rs b/exercises/threads/threads3.rs index d3450668..68c0afa2 100644 --- a/exercises/threads/threads3.rs +++ b/exercises/threads/threads3.rs @@ -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) -> () { 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 {