rust/src/test/run-pass/yield.rs

19 lines
309 B
Rust
Raw Normal View History

2010-06-23 23:03:09 -05:00
// -*- rust -*-
use std;
2011-08-12 20:34:19 -05:00
import std::task;
import std::task::*;
2010-06-23 23:03:09 -05:00
fn main() {
let other = task::spawn_joinable2((), child);
log_err "1";
yield();
log_err "2";
yield();
log_err "3";
join(other);
2010-06-23 23:03:09 -05:00
}
fn# child(&&_i: ()) {
log_err "4"; yield(); log_err "5"; yield(); log_err "6";
}