We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 16d9b90 commit e977866Copy full SHA for e977866
1 file changed
README.md
@@ -16,10 +16,12 @@ fn main() {
16
let pool = pool::WorkerPool::new(nworkers);
17
18
let (tx, rx) = mpsc::channel();
19
+ let atx = Arc::new(Mutex::new(tx));
20
21
for _ in 0..njobs {
- let tx = tx.clone();
22
+ let atx = atx.clone();
23
pool.execute(Box::new(move || {
24
+ let tx = atx.lock().unwrap();
25
tx.send(1).expect("channel waiting for pool");
26
}));
27
}
0 commit comments