diff options
author | Tim Kuehn <tkuehn@cmu.edu> | 2013-09-19 16:47:01 -0400 |
---|---|---|
committer | Tim Kuehn <tkuehn@cmu.edu> | 2013-09-19 17:28:49 -0400 |
commit | 6c28b5cc9c016a0cf1f0e5c1905f3a59ecb7beab (patch) | |
tree | 5add1430e6edca2eeba38a18abcb874eaa1ff3d0 /src/components/script/script_task.rs | |
parent | 7ffcc29d54659cea63dd2769db469473343246c4 (diff) | |
download | servo-6c28b5cc9c016a0cf1f0e5c1905f3a59ecb7beab.tar.gz servo-6c28b5cc9c016a0cf1f0e5c1905f3a59ecb7beab.zip |
use spawn_with in lieu of cells
Diffstat (limited to 'src/components/script/script_task.rs')
-rw-r--r-- | src/components/script/script_task.rs | 30 |
1 files changed, 13 insertions, 17 deletions
diff --git a/src/components/script/script_task.rs b/src/components/script/script_task.rs index 5ccdacad9be..55311b5cf2a 100644 --- a/src/components/script/script_task.rs +++ b/src/components/script/script_task.rs @@ -25,12 +25,11 @@ use servo_msg::constellation_msg::{PipelineId, SubpageId, RendererReadyMsg}; use servo_msg::constellation_msg::{LoadIframeUrlMsg, IFrameSandboxed, IFrameUnsandboxed}; use servo_msg::constellation_msg; -use std::cell::Cell; use std::comm; use std::comm::{Port, SharedChan}; use std::io::read_whole_file; use std::ptr; -use std::task::{SingleThreaded, task}; +use std::task::spawn_with; use std::util::replace; use dom::window::TimerData; use geom::size::Size2D; @@ -435,22 +434,19 @@ impl ScriptTask { resource_task: ResourceTask, image_cache_task: ImageCacheTask, initial_size: Future<Size2D<uint>>) { - let compositor = Cell::new(compositor); - let port = Cell::new(port); - let initial_size = Cell::new(initial_size); - // FIXME: rust#6399 - let mut the_task = task(); - the_task.sched_mode(SingleThreaded); - do spawn { + do spawn_with((compositor, layout_chan, port, chan, constellation_chan, + resource_task, image_cache_task, initial_size)) + |(compositor, layout_chan, port, chan, constellation_chan, + resource_task, image_cache_task, initial_size)| { let script_task = ScriptTask::new(id, - @compositor.take() as @ScriptListener, - layout_chan.clone(), - port.take(), - chan.clone(), - constellation_chan.clone(), - resource_task.clone(), - image_cache_task.clone(), - initial_size.take()); + @compositor as @ScriptListener, + layout_chan, + port, + chan, + constellation_chan, + resource_task, + image_cache_task, + initial_size); script_task.start(); } } |