aboutsummaryrefslogtreecommitdiffstats
path: root/components/util/workqueue.rs
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2016-01-10 15:49:04 +0530
committerbors-servo <lbergstrom+bors@mozilla.com>2016-01-10 15:49:04 +0530
commitd3e2f94f2024f4735f836588ed11303a0abafdf8 (patch)
tree1635c4fa9cc826a29ce15d22690687170978f0b9 /components/util/workqueue.rs
parentaa713c9fbb56fd3f1427779bb31ec48dee316187 (diff)
parent1f02c4ebbb7d5ea49051f4391f1418f20c15d7a9 (diff)
downloadservo-d3e2f94f2024f4735f836588ed11303a0abafdf8.tar.gz
servo-d3e2f94f2024f4735f836588ed11303a0abafdf8.zip
Auto merge of #9201 - wenderen:8512-task-thread, r=jdm
task -> thread for #8512 <!-- Reviewable:start --> [<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9201) <!-- Reviewable:end -->
Diffstat (limited to 'components/util/workqueue.rs')
-rw-r--r--components/util/workqueue.rs12
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()
})