aboutsummaryrefslogtreecommitdiffstats
path: root/components/util/workqueue.rs
diff options
context:
space:
mode:
authorbors-servo <metajack+bors@gmail.com>2015-02-20 23:06:48 -0700
committerbors-servo <metajack+bors@gmail.com>2015-02-20 23:06:48 -0700
commitd26345f868e4261760ce204bdc383941e8f14621 (patch)
tree30a388ece84d10848ef3a2230c0162db6f8127a3 /components/util/workqueue.rs
parentd326e75c5e0314903ed2d297dcb72e535c543c2f (diff)
parent40a3b417580f1050c63acf890ed5aaefb6197d1a (diff)
downloadservo-d26345f868e4261760ce204bdc383941e8f14621.tar.gz
servo-d26345f868e4261760ce204bdc383941e8f14621.zip
auto merge of #4994 : pcwalton/servo/layout-tinting, r=pcwalton
r? @metajack
Diffstat (limited to 'components/util/workqueue.rs')
-rw-r--r--components/util/workqueue.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/components/util/workqueue.rs b/components/util/workqueue.rs
index 69fbce97b7e..ad39b1e349f 100644
--- a/components/util/workqueue.rs
+++ b/components/util/workqueue.rs
@@ -157,6 +157,7 @@ impl<QueueData: Send, WorkData: Send> WorkerThread<QueueData, WorkData> {
worker: &mut deque,
ref_count: ref_count,
queue_data: queue_data,
+ worker_index: self.index as u8,
};
(work_unit.fun)(work_unit.data, &mut proxy);
@@ -180,6 +181,7 @@ pub struct WorkerProxy<'a, QueueData: 'a, WorkData: 'a> {
worker: &'a mut Worker<WorkUnit<QueueData, WorkData>>,
ref_count: *mut AtomicUint,
queue_data: *const QueueData,
+ worker_index: u8,
}
impl<'a, QueueData: 'static, WorkData: Send> WorkerProxy<'a, QueueData, WorkData> {
@@ -199,6 +201,12 @@ impl<'a, QueueData: 'static, WorkData: Send> WorkerProxy<'a, QueueData, WorkData
mem::transmute(self.queue_data)
}
}
+
+ /// Retrieves the index of the worker.
+ #[inline]
+ pub fn worker_index(&self) -> u8 {
+ self.worker_index
+ }
}
/// A work queue on which units of work can be submitted.