Skip to content

Commit

Permalink
Enhance README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
jgardona committed May 4, 2023
1 parent 16d9b90 commit e977866
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@ fn main() {
let pool = pool::WorkerPool::new(nworkers);

let (tx, rx) = mpsc::channel();
let atx = Arc::new(Mutex::new(tx));

for _ in 0..njobs {
let tx = tx.clone();
let atx = atx.clone();
pool.execute(Box::new(move || {
let tx = atx.lock().unwrap();
tx.send(1).expect("channel waiting for pool");
}));
}
Expand Down

0 comments on commit e977866

Please sign in to comment.