Noelle 4 år sedan
förälder
incheckning
f439c1417d
1 ändrade filer med 10 tillägg och 0 borttagningar
  1. 10
    0
      src/lib.rs

+ 10
- 0
src/lib.rs Visa fil

@@ -46,6 +46,16 @@ impl ThreadPool {

}

impl Drop for ThreadPool {
fn drop(&mut self) {
for worker in &mut self.workers {
println!("Shutting down worker {}", worker.id);

worker.thread.join().unwrap();
}
}
}

struct Worker {
id: usize,
thread: thread::JoinHandle<()>,

Laddar…
Avbryt
Spara