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
let content = content::content(layout);
// The keyboard handler
let key_po = port();
send(osmain, platform::osmain::add_key_handler(chan(key_po)));
// Wait for keypress
listen {|key_ch|
send(osmain, platform::osmain::add_key_handler(key_ch));
key_po.recv();
comm::send(content, content::exit);
comm::send(layout, layout::layout::exit);
key_ch.recv();
}
let draw_exit_confirm_po = comm::port();
comm::send(renderer, gfx::renderer::exit(comm::chan(draw_exit_confirm_po)));
// Shut everything down
content.send(content::exit);
layout.send(layout::layout::exit);
comm::recv(draw_exit_confirm_po);
comm::send(osmain, platform::osmain::exit);
listen {|wait_ch|
renderer.send(gfx::renderer::exit(wait_ch));
wait_ch.recv();
}
osmain.send(platform::osmain::exit);
}