add names for all servo spawned tasks

* add servo_util::task::{spawn_named,spawn_with_named} functions

* add name param for spawn_listener and spawn_conversation functions

this should resolve #1169
This commit is contained in:
zmike 2014-01-03 15:43:11 -05:00 committed by Mike Blumenkrantz
parent 99f24fbd40
commit 193b6d2635
19 changed files with 55 additions and 31 deletions

View file

@ -16,6 +16,7 @@ use layout_interface::{ReflowForDisplay, DocumentDamageLevel};
use script_task::{ExitWindowMsg, FireTimerMsg, Page, ScriptChan};
use servo_msg::compositor_msg::ScriptListener;
use servo_net::image_cache_task::ImageCacheTask;
use servo_util::task::{spawn_named};
use js::glue::*;
use js::jsapi::{JSObject, JSContext, JS_DefineProperty, JSTracer, JSVal};
@ -193,7 +194,7 @@ impl Window {
let tm = Timer::new().unwrap();
let (cancel_port, cancel_chan) = Chan::new();
let chan = self.timer_chan.clone();
spawn(proc() {
spawn_named("Window:SetTimeout", proc() {
let mut tm = tm;
let mut timeout_port = tm.oneshot(timeout);
let mut cancel_port = cancel_port;
@ -248,7 +249,7 @@ impl Window {
timer_chan: {
let (timer_port, timer_chan): (Port<TimerControlMsg>, SharedChan<TimerControlMsg>) = SharedChan::new();
let id = page.id.clone();
spawn(proc() {
spawn_named("timer controller", proc() {
loop {
match timer_port.recv() {
TimerMessage_Close => break,