diff options
author | rohan.prinja <rohan.prinja@samsung.com> | 2015-11-14 05:07:55 +0900 |
---|---|---|
committer | Rohan Prinja <rohan.prinja@gmail.com> | 2016-01-10 17:58:13 +0900 |
commit | 1f02c4ebbb7d5ea49051f4391f1418f20c15d7a9 (patch) | |
tree | 7d61e58e746ddca93074ca6bca6849360a098b8c /components/util/workqueue.rs | |
parent | f00532bab0382d1c24e6086314f26497fb6ffe0f (diff) | |
download | servo-1f02c4ebbb7d5ea49051f4391f1418f20c15d7a9.tar.gz servo-1f02c4ebbb7d5ea49051f4391f1418f20c15d7a9.zip |
task -> thread
Diffstat (limited to 'components/util/workqueue.rs')
-rw-r--r-- | components/util/workqueue.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/components/util/workqueue.rs b/components/util/workqueue.rs index dd7c4dd355a..a05879412f3 100644 --- a/components/util/workqueue.rs +++ b/components/util/workqueue.rs @@ -12,8 +12,8 @@ use libc::usleep; use rand::{Rng, XorShiftRng, weak_rng}; use std::sync::atomic::{AtomicUsize, Ordering}; use std::sync::mpsc::{Receiver, Sender, channel}; -use task::spawn_named; -use task_state; +use thread::spawn_named; +use thread_state; /// A unit of work. /// @@ -234,8 +234,8 @@ pub struct WorkQueue<QueueData: 'static, WorkData: 'static> { impl<QueueData: Sync, WorkData: Send> WorkQueue<QueueData, WorkData> { /// Creates a new work queue and spawns all the threads associated with /// it. - pub fn new(task_name: &'static str, - state: task_state::TaskState, + pub fn new(thread_name: &'static str, + state: thread_state::ThreadState, thread_count: usize) -> WorkQueue<QueueData, WorkData> { // Set up data structures. let (supervisor_chan, supervisor_port) = channel(); @@ -272,9 +272,9 @@ impl<QueueData: Sync, WorkData: Send> WorkQueue<QueueData, WorkData> { for (i, thread) in threads.into_iter().enumerate() { spawn_named( - format!("{} worker {}/{}", task_name, i + 1, thread_count), + format!("{} worker {}/{}", thread_name, i + 1, thread_count), move || { - task_state::initialize(state | task_state::IN_WORKER); + thread_state::initialize(state | thread_state::IN_WORKER); let mut thread = thread; thread.start() }) |