summary refs log tree commit diff
path: root/src/test/run-pass/yield1.rs
blob: 05c5e833babfb12c132e89e9d9537ef6e93a6eaa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
// -*- rust -*-
extern mod std;
use task::*;

fn main() {
    let mut result = None;
    task::task().future_result(|+r| { result = Some(r); }).spawn(child);
    error!("1");
    yield();
    future::get(&option::unwrap(result));
}

fn child() { error!("2"); }