aboutsummaryrefslogtreecommitdiffstats
path: root/components/util/workqueue.rs
diff options
context:
space:
mode:
authorKeegan McAllister <kmcallister@mozilla.com>2014-10-23 14:44:17 -0700
committerKeegan McAllister <kmcallister@mozilla.com>2014-10-24 16:27:37 -0700
commit6ec0939a2248e0e092242076ed5b2cd2486c736c (patch)
treecd945ad95c170c95a99ca96259c7d20bf2b35424 /components/util/workqueue.rs
parent0162214b1fce3787bb08118790fc4d59d8528306 (diff)
downloadservo-6ec0939a2248e0e092242076ed5b2cd2486c736c.tar.gz
servo-6ec0939a2248e0e092242076ed5b2cd2486c736c.zip
Dynamically check DOMRefCell access from layout in debug builds
Diffstat (limited to 'components/util/workqueue.rs')
-rw-r--r--components/util/workqueue.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/components/util/workqueue.rs b/components/util/workqueue.rs
index a9f9419d81c..3a0b3e32f91 100644
--- a/components/util/workqueue.rs
+++ b/components/util/workqueue.rs
@@ -7,6 +7,8 @@
//! 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 task_state;
+
use native::task::NativeTaskBuilder;
use rand::{Rng, XorShiftRng};
use std::mem;
@@ -196,7 +198,10 @@ pub struct WorkQueue<QueueData, WorkData> {
impl<QueueData: Send, 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, thread_count: uint, user_data: QueueData) -> WorkQueue<QueueData, WorkData> {
+ pub fn new(task_name: &'static str,
+ state: task_state::TaskState,
+ thread_count: uint,
+ user_data: QueueData) -> WorkQueue<QueueData, WorkData> {
// Set up data structures.
let (supervisor_chan, supervisor_port) = channel();
let (mut infos, mut threads) = (vec!(), vec!());
@@ -231,6 +236,7 @@ impl<QueueData: Send, WorkData: Send> WorkQueue<QueueData, WorkData> {
// Spawn threads.
for thread in threads.into_iter() {
TaskBuilder::new().named(task_name).native().spawn(proc() {
+ task_state::initialize(state | task_state::InWorker);
let mut thread = thread;
thread.start()
})