use std::sync::{Mutex, TryLockError};
use std::thread::yield_now;
-use current_num_threads;
-use iter::plumbing::{bridge_unindexed, Folder, UnindexedConsumer, UnindexedProducer};
-use iter::ParallelIterator;
+use crate::current_num_threads;
+use crate::iter::plumbing::{bridge_unindexed, Folder, UnindexedConsumer, UnindexedProducer};
+use crate::iter::ParallelIterator;
/// Conversion trait to convert an `Iterator` to a `ParallelIterator`.
///
/// assert_eq!(&*output, &["one!", "three!", "two!"]);
/// ```
pub trait ParallelBridge: Sized {
- /// Create a bridge from this type to a `ParallelIterator`.
+ /// Creates a bridge from this type to a `ParallelIterator`.
fn par_bridge(self) -> IterBridge<Self>;
}
}
}
-struct IterParallelProducer<'a, Iter: Iterator + 'a> {
+struct IterParallelProducer<'a, Iter: Iterator> {
split_count: &'a AtomicUsize,
done: &'a AtomicBool,
iter: &'a Mutex<(Iter, Worker<Iter::Item>)>,