aboutsummaryrefslogtreecommitdiffstats
path: root/components/util/workqueue.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/util/workqueue.rs')
-rw-r--r--components/util/workqueue.rs10
1 files changed, 6 insertions, 4 deletions
diff --git a/components/util/workqueue.rs b/components/util/workqueue.rs
index c24f40602f9..b1709cdf6e0 100644
--- a/components/util/workqueue.rs
+++ b/components/util/workqueue.rs
@@ -7,15 +7,15 @@
//! Data associated with queues is simply a pair of unsigned integers. It is expected that a
//! higher-level API on top of this could allow safe fork-join parallelism.
+use deque::{Abort, BufferPool, Data, Empty, Stealer, Worker};
use task::spawn_named;
use task_state;
use libc::funcs::posix88::unistd::usleep;
-use std::mem;
use rand::{Rng, weak_rng, XorShiftRng};
+use std::mem;
use std::sync::atomic::{AtomicUsize, Ordering};
use std::sync::mpsc::{channel, Sender, Receiver};
-use deque::{Abort, BufferPool, Data, Empty, Stealer, Worker};
/// A unit of work.
///
@@ -184,7 +184,7 @@ pub struct WorkerProxy<'a, QueueData: 'a, WorkData: 'a> {
worker_index: u8,
}
-impl<'a, QueueData: 'static, WorkData: Send> WorkerProxy<'a, QueueData, WorkData> {
+impl<'a, QueueData: 'static, WorkData: Send + 'static> WorkerProxy<'a, QueueData, WorkData> {
/// Enqueues a block into the work queue.
#[inline]
pub fn push(&mut self, work_unit: WorkUnit<QueueData, WorkData>) {
@@ -297,7 +297,9 @@ impl<QueueData: Send, WorkData: Send> WorkQueue<QueueData, WorkData> {
// Tell the workers to start.
let mut work_count = AtomicUsize::new(self.work_count);
for worker in self.workers.iter_mut() {
- worker.chan.send(WorkerMsg::Start(worker.deque.take().unwrap(), &mut work_count, &self.data)).unwrap()
+ worker.chan.send(WorkerMsg::Start(worker.deque.take().unwrap(),
+ &mut work_count,
+ &self.data)).unwrap()
}
// Wait for the work to finish.