2010-06-23 23:03:09 -05:00
|
|
|
// -*- rust -*-
|
|
|
|
|
2011-08-11 00:48:17 -05:00
|
|
|
use std;
|
|
|
|
import std::task::yield;
|
2011-08-13 17:20:11 -05:00
|
|
|
import std::task;
|
2011-08-11 00:48:17 -05:00
|
|
|
|
2011-09-01 18:39:51 -05:00
|
|
|
fn x(s: -istr, n: int) { log s; log n; }
|
2010-06-23 23:03:09 -05:00
|
|
|
|
|
|
|
fn main() {
|
2011-09-01 18:39:51 -05:00
|
|
|
task::spawn(bind x(~"hello from first spawned fn", 65));
|
|
|
|
task::spawn(bind x(~"hello from second spawned fn", 66));
|
|
|
|
task::spawn(bind x(~"hello from third spawned fn", 67));
|
2011-07-27 07:19:39 -05:00
|
|
|
let i: int = 30;
|
2011-08-11 00:48:17 -05:00
|
|
|
while i > 0 { i = i - 1; log "parent sleeping"; yield(); }
|
2011-08-19 17:16:48 -05:00
|
|
|
}
|