mirror of
https://github.com/servo/servo.git
synced 2025-06-09 09:03:23 +00:00
Stop using the deprecated Thunk API.
This commit is contained in:
parent
995985b985
commit
079049cfac
2 changed files with 3 additions and 4 deletions
|
@ -16,7 +16,6 @@
|
||||||
#![feature(slice_extras)]
|
#![feature(slice_extras)]
|
||||||
#![feature(step_by)]
|
#![feature(step_by)]
|
||||||
#![feature(step_trait)]
|
#![feature(step_trait)]
|
||||||
#![feature(thunk)]
|
|
||||||
#![feature(zero_one)]
|
#![feature(zero_one)]
|
||||||
|
|
||||||
#![plugin(string_cache_plugin)]
|
#![plugin(string_cache_plugin)]
|
||||||
|
|
|
@ -16,12 +16,12 @@
|
||||||
//
|
//
|
||||||
|
|
||||||
use task::spawn_named;
|
use task::spawn_named;
|
||||||
|
use std::boxed::FnBox;
|
||||||
use std::sync::{Arc, Mutex};
|
use std::sync::{Arc, Mutex};
|
||||||
use std::sync::mpsc::{channel, Sender, Receiver};
|
use std::sync::mpsc::{channel, Sender, Receiver};
|
||||||
use std::thunk::Thunk;
|
|
||||||
|
|
||||||
pub struct TaskPool {
|
pub struct TaskPool {
|
||||||
tx: Sender<Thunk<'static, ()>>,
|
tx: Sender<Box<FnBox() + Send + 'static>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl TaskPool {
|
impl TaskPool {
|
||||||
|
@ -40,7 +40,7 @@ impl TaskPool {
|
||||||
|
|
||||||
return TaskPool { tx: tx };
|
return TaskPool { tx: tx };
|
||||||
|
|
||||||
fn worker(rx: &Mutex<Receiver<Thunk<()>>>) {
|
fn worker(rx: &Mutex<Receiver<Box<FnBox() + Send + 'static>>>) {
|
||||||
loop {
|
loop {
|
||||||
let job = rx.lock().unwrap().recv();
|
let job = rx.lock().unwrap().recv();
|
||||||
match job {
|
match job {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue