mirror of
https://github.com/servo/servo.git
synced 2025-07-23 15:23:42 +01: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,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