20 lines
365 B
Rust
20 lines
365 B
Rust
// -*- rust -*-
|
|
use std;
|
|
import task;
|
|
import task::*;
|
|
|
|
fn main() {
|
|
let mut result = None;
|
|
task::task().future_result(|+r| { result = Some(r); }).spawn(child);
|
|
error!("1");
|
|
yield();
|
|
error!("2");
|
|
yield();
|
|
error!("3");
|
|
future::get(&option::unwrap(result));
|
|
}
|
|
|
|
fn child() {
|
|
error!("4"); yield(); error!("5"); yield(); error!("6");
|
|
}
|