Skip to content

Commit e977866

Browse files
committed
Enhance README.md
1 parent 16d9b90 commit e977866

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,12 @@ fn main() {
1616
let pool = pool::WorkerPool::new(nworkers);
1717

1818
let (tx, rx) = mpsc::channel();
19+
let atx = Arc::new(Mutex::new(tx));
1920

2021
for _ in 0..njobs {
21-
let tx = tx.clone();
22+
let atx = atx.clone();
2223
pool.execute(Box::new(move || {
24+
let tx = atx.lock().unwrap();
2325
tx.send(1).expect("channel waiting for pool");
2426
}));
2527
}

0 commit comments

Comments
 (0)