|
|
|
@ -67,6 +67,7 @@ pub fn join_all<T>(i: impl IntoIterator<Item = JoinHandle<T>>)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// A pool container that ensures worker threads are waited on before termination.
|
|
|
|
|
#[derive(Debug)]
|
|
|
|
|
pub struct Pool(Vec<JoinHandle<()>>);
|
|
|
|
|
|
|
|
|
|
impl Pool
|
|
|
|
@ -77,7 +78,7 @@ impl Pool
|
|
|
|
|
drop(self)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// Detach the pool and do not join its worker threads.
|
|
|
|
|
/// Detach the pool but do not join its worker threads.
|
|
|
|
|
#[inline] pub fn detach(mut self)
|
|
|
|
|
{
|
|
|
|
|
self.0 = Vec::default();
|
|
|
|
|