Modernize servo.rs

This commit is contained in:
Brian Anderson 2012-05-04 00:14:00 -07:00
parent 7ec7daf585
commit 663ffdc5a9

View file

@ -36,17 +36,20 @@ fn main(args: [str]) {
// The content task // The content task
let content = content::content(layout); let content = content::content(layout);
// The keyboard handler // Wait for keypress
let key_po = port(); listen {|key_ch|
send(osmain, platform::osmain::add_key_handler(chan(key_po))); send(osmain, platform::osmain::add_key_handler(key_ch));
key_po.recv(); key_ch.recv();
comm::send(content, content::exit); }
comm::send(layout, layout::layout::exit);
let draw_exit_confirm_po = comm::port(); // Shut everything down
comm::send(renderer, gfx::renderer::exit(comm::chan(draw_exit_confirm_po))); content.send(content::exit);
layout.send(layout::layout::exit);
comm::recv(draw_exit_confirm_po); listen {|wait_ch|
comm::send(osmain, platform::osmain::exit); renderer.send(gfx::renderer::exit(wait_ch));
wait_ch.recv();
}
osmain.send(platform::osmain::exit);
} }