mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
Make some scary things in the workqueue module private
This commit is contained in:
parent
50c2af8ef1
commit
69a3d100ad
1 changed files with 5 additions and 5 deletions
|
@ -77,7 +77,7 @@ static SPIN_COUNT: uint = 1000;
|
||||||
impl<QUD:Send,WUD:Send> WorkerThread<QUD,WUD> {
|
impl<QUD:Send,WUD:Send> WorkerThread<QUD,WUD> {
|
||||||
/// The main logic. This function starts up the worker and listens for
|
/// The main logic. This function starts up the worker and listens for
|
||||||
/// messages.
|
/// messages.
|
||||||
pub fn start(&mut self) {
|
fn start(&mut self) {
|
||||||
loop {
|
loop {
|
||||||
// Wait for a start message.
|
// Wait for a start message.
|
||||||
let (mut deque, ref_count, queue_data) = match self.port.recv() {
|
let (mut deque, ref_count, queue_data) = match self.port.recv() {
|
||||||
|
@ -161,9 +161,9 @@ impl<QUD:Send,WUD:Send> WorkerThread<QUD,WUD> {
|
||||||
|
|
||||||
/// A handle to the work queue that individual work units have.
|
/// A handle to the work queue that individual work units have.
|
||||||
pub struct WorkerProxy<'a,QUD,WUD> {
|
pub struct WorkerProxy<'a,QUD,WUD> {
|
||||||
pub worker: &'a mut Worker<WorkUnit<QUD,WUD>>,
|
worker: &'a mut Worker<WorkUnit<QUD,WUD>>,
|
||||||
pub ref_count: *mut AtomicUint,
|
ref_count: *mut AtomicUint,
|
||||||
pub queue_data: *QUD,
|
queue_data: *QUD,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<'a,QUD,WUD:Send> WorkerProxy<'a,QUD,WUD> {
|
impl<'a,QUD,WUD:Send> WorkerProxy<'a,QUD,WUD> {
|
||||||
|
@ -192,7 +192,7 @@ pub struct WorkQueue<QUD,WUD> {
|
||||||
/// A port on which deques can be received from the workers.
|
/// A port on which deques can be received from the workers.
|
||||||
port: Receiver<SupervisorMsg<QUD,WUD>>,
|
port: Receiver<SupervisorMsg<QUD,WUD>>,
|
||||||
/// The amount of work that has been enqueued.
|
/// The amount of work that has been enqueued.
|
||||||
pub work_count: uint,
|
work_count: uint,
|
||||||
/// Arbitrary user data.
|
/// Arbitrary user data.
|
||||||
pub data: QUD,
|
pub data: QUD,
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue