diff options
author | Clark Gaebel <cgaebel@mozilla.com> | 2014-10-28 09:53:45 -0700 |
---|---|---|
committer | Clark Gaebel <cgaebel@mozilla.com> | 2014-10-28 09:53:45 -0700 |
commit | 6df1cc8e4c1ed6c4a99435808f7e236eedaed0a1 (patch) | |
tree | dbf10231b9ceee58d3891d7ffab6840f5f561ab3 /components/net/image_cache_task.rs | |
parent | 9e94ecf99cff7c57275ab39c7b11870e55756d63 (diff) | |
download | servo-6df1cc8e4c1ed6c4a99435808f7e236eedaed0a1.tar.gz servo-6df1cc8e4c1ed6c4a99435808f7e236eedaed0a1.zip |
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)
Diffstat (limited to 'components/net/image_cache_task.rs')
-rw-r--r-- | components/net/image_cache_task.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/components/net/image_cache_task.rs b/components/net/image_cache_task.rs index 56ce7335048..e3e9bd952a6 100644 --- a/components/net/image_cache_task.rs +++ b/components/net/image_cache_task.rs @@ -6,11 +6,11 @@ use image::base::{Image, load_from_memory}; use resource_task; use resource_task::{LoadData, ResourceTask}; +use servo_util::task::spawn_named; use servo_util::taskpool::TaskPool; use std::comm::{channel, Receiver, Sender}; use std::collections::hashmap::HashMap; use std::mem::replace; -use std::task::spawn; use std::result; use sync::{Arc, Mutex}; use serialize::{Encoder, Encodable}; @@ -84,7 +84,7 @@ impl ImageCacheTask { let (chan, port) = channel(); let chan_clone = chan.clone(); - spawn(proc() { + spawn_named("image-cache-task", proc() { let mut cache = ImageCache { resource_task: resource_task, port: port, @@ -105,7 +105,7 @@ impl ImageCacheTask { pub fn new_sync(resource_task: ResourceTask, task_pool: TaskPool) -> ImageCacheTask { let (chan, port) = channel(); - spawn(proc() { + spawn_named("image-cache-task-sync", proc() { let inner_cache = ImageCacheTask::new(resource_task, task_pool); loop { @@ -248,7 +248,7 @@ impl ImageCache { let resource_task = self.resource_task.clone(); let url_clone = url.clone(); - spawn(proc() { + spawn_named("image-cache-task-prefetch", proc() { let url = url_clone; debug!("image_cache_task: started fetch for {:s}", url.serialize()); @@ -463,7 +463,7 @@ fn load_image_data(url: Url, resource_task: ResourceTask) -> Result<Vec<u8>, ()> pub fn spawn_listener<A: Send>(f: proc(Receiver<A>):Send) -> Sender<A> { let (setup_chan, setup_port) = channel(); - spawn(proc() { + spawn_named("image-cache-task-listener", proc() { let (chan, port) = channel(); setup_chan.send(chan); f(port); |