diff options
Diffstat (limited to 'src/components/util/workqueue.rs')
-rw-r--r-- | src/components/util/workqueue.rs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/components/util/workqueue.rs b/src/components/util/workqueue.rs index 93ea740c5a0..b5f4fc0799d 100644 --- a/src/components/util/workqueue.rs +++ b/src/components/util/workqueue.rs @@ -15,6 +15,7 @@ use std::rand::{Rng, XorShiftRng}; use std::rand; use std::sync::atomics::{AtomicUint, SeqCst}; use std::sync::deque::{Abort, BufferPool, Data, Empty, Stealer, Worker}; +use std::task::TaskOpts; /// A unit of work. /// @@ -200,7 +201,7 @@ pub struct WorkQueue<QUD,WUD> { impl<QUD:Send,WUD:Send> WorkQueue<QUD,WUD> { /// Creates a new work queue and spawns all the threads associated with /// it. - pub fn new(thread_count: uint, user_data: QUD) -> WorkQueue<QUD,WUD> { + pub fn new(task_name: &'static str, thread_count: uint, user_data: QUD) -> WorkQueue<QUD,WUD> { // Set up data structures. let (supervisor_port, supervisor_chan) = Chan::new(); let (mut infos, mut threads) = (~[], ~[]); @@ -235,7 +236,9 @@ impl<QUD:Send,WUD:Send> WorkQueue<QUD,WUD> { // Spawn threads. for thread in threads.move_iter() { - native::task::spawn(proc() { + let mut opts = TaskOpts::new(); + opts.name = Some(task_name.into_maybe_owned()); + native::task::spawn_opts(opts, proc() { let mut thread = thread; thread.start() }) |