diff options
Diffstat (limited to 'src/components/util/time.rs')
-rw-r--r-- | src/components/util/time.rs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/components/util/time.rs b/src/components/util/time.rs index 59b01d264e7..911100bcb36 100644 --- a/src/components/util/time.rs +++ b/src/components/util/time.rs @@ -8,7 +8,7 @@ use extra::time::precise_time_ns; use extra::treemap::TreeMap; use std::comm::{Port, SharedChan}; use std::iter::AdditiveIterator; - +use task::{spawn_named}; // TODO: This code should be changed to use the commented code that uses timers // directly, once native timers land in Rust. @@ -26,7 +26,6 @@ impl Timer { } } - // front-end representation of the profiler used to communicate with the profiler #[deriving(Clone)] pub struct ProfilerChan(SharedChan<ProfilerMsg>); @@ -117,7 +116,7 @@ impl Profiler { Some(period) => { let period = (period * 1000f64) as u64; let chan = chan.clone(); - spawn(proc() { + spawn_named("Profiler timer", proc() { loop { Timer::sleep(period); if !chan.try_send(PrintMsg) { @@ -126,14 +125,14 @@ impl Profiler { } }); // Spawn the profiler - spawn(proc() { + spawn_named("Profiler", proc() { let mut profiler = Profiler::new(port); profiler.start(); }); } None => { // no-op to handle profiler messages when the profiler is inactive - spawn(proc() { + spawn_named("Profiler", proc() { while port.recv_opt().is_some() {} }); } |