PageRenderTime 15ms CodeModel.GetById 12ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/src/test/run-pass/yield1.rs

http://github.com/jruderman/rust
Rust | 14 lines | 11 code | 2 blank | 1 comment | 0 complexity | 17e39b899e70fc61fdaadd6645120bab MD5 | raw file
 1// -*- rust -*-
 2use std;
 3import task;
 4import task::*;
 5
 6fn main() {
 7    let mut result = none;
 8    task::task().future_result(|-r| { result = some(r); }).spawn(child);
 9    error!{"1"};
10    yield();
11    future::get(option::unwrap(result));
12}
13
14fn child() { error!{"2"}; }