mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
Change osmain.rs to new task::task_builder interface
This commit is contained in:
parent
61394b5d5e
commit
fba942c7c6
1 changed files with 2 additions and 10 deletions
|
@ -13,6 +13,7 @@ import dom::event::{Event, ResizeEvent};
|
||||||
import layers::ImageLayer;
|
import layers::ImageLayer;
|
||||||
import geom::size::Size2D;
|
import geom::size::Size2D;
|
||||||
import std::cmp::fuzzy_eq;
|
import std::cmp::fuzzy_eq;
|
||||||
|
import task::task_builder;
|
||||||
import vec::push;
|
import vec::push;
|
||||||
|
|
||||||
type OSMain = chan<Msg>;
|
type OSMain = chan<Msg>;
|
||||||
|
@ -222,16 +223,7 @@ fn destroy_surface(+surface: surface) {
|
||||||
|
|
||||||
#[doc = "A function for spawning into the platform's main thread"]
|
#[doc = "A function for spawning into the platform's main thread"]
|
||||||
fn on_osmain<T: send>(+f: fn~(comm::port<T>)) -> comm::chan<T> {
|
fn on_osmain<T: send>(+f: fn~(comm::port<T>)) -> comm::chan<T> {
|
||||||
let builder = task::builder();
|
task::task().sched_mode(task::osmain).spawn_listener(f)
|
||||||
let opts = {
|
|
||||||
sched: some({
|
|
||||||
mode: task::osmain,
|
|
||||||
foreign_stack_size: none
|
|
||||||
})
|
|
||||||
with task::get_opts(builder)
|
|
||||||
};
|
|
||||||
task::set_opts(builder, opts);
|
|
||||||
ret task::run_listener(builder, f);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// #[cfg(target_os = "linux")]
|
// #[cfg(target_os = "linux")]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue