Run all task spawning through util, to allow for easy hooking.

During debugging, I found it useful to hook all task creation in a
central location, and util::task was the perfect place for it.

r? @pcwalton (or maybe someone else, I'm kinda sending you a bunch of
reviews today because I don't know who better to give them to)
This commit is contained in:
Clark Gaebel 2014-10-28 09:53:45 -07:00
parent 9e94ecf99c
commit 6df1cc8e4c
14 changed files with 48 additions and 36 deletions

View file

@ -6,9 +6,9 @@ use azure::azure_hl::{DrawTarget, Color, B8G8R8A8, SkiaBackend, StrokeOptions, D
use azure::azure_hl::{ColorPattern, ColorPatternRef};
use geom::rect::Rect;
use geom::size::Size2D;
use servo_util::task::spawn_named;
use std::comm;
use std::task::TaskBuilder;
pub enum CanvasMsg {
FillRect(Rect<f32>),
@ -37,8 +37,7 @@ impl CanvasRenderTask {
pub fn start(size: Size2D<i32>) -> Sender<CanvasMsg> {
let (chan, port) = comm::channel::<CanvasMsg>();
let builder = TaskBuilder::new().named("CanvasTask");
builder.spawn(proc() {
spawn_named("CanvasTask", proc() {
let mut renderer = CanvasRenderTask::new(size);
loop {