mirror of
https://github.com/servo/servo.git
synced 2025-06-08 16:43:28 +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(step_by)]
|
||||
#![feature(step_trait)]
|
||||
#![feature(thunk)]
|
||||
#![feature(zero_one)]
|
||||
|
||||
#![plugin(string_cache_plugin)]
|
||||
|
|
|
@ -16,12 +16,12 @@
|
|||
//
|
||||
|
||||
use task::spawn_named;
|
||||
use std::boxed::FnBox;
|
||||
use std::sync::{Arc, Mutex};
|
||||
use std::sync::mpsc::{channel, Sender, Receiver};
|
||||
use std::thunk::Thunk;
|
||||
|
||||
pub struct TaskPool {
|
||||
tx: Sender<Thunk<'static, ()>>,
|
||||
tx: Sender<Box<FnBox() + Send + 'static>>,
|
||||
}
|
||||
|
||||
impl TaskPool {
|
||||
|
@ -40,7 +40,7 @@ impl TaskPool {
|
|||
|
||||
return TaskPool { tx: tx };
|
||||
|
||||
fn worker(rx: &Mutex<Receiver<Thunk<()>>>) {
|
||||
fn worker(rx: &Mutex<Receiver<Box<FnBox() + Send + 'static>>>) {
|
||||
loop {
|
||||
let job = rx.lock().unwrap().recv();
|
||||
match job {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue