about summary refs log tree commit diff
path: root/src/test/run-pass/spawn-fn.rs
blob: df64e47bbf8abe060c1e8f5a11b3cee1939fcfbd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// -*- rust -*-

use std;
import task::yield;
import task;

fn x(&&args: (str, int)) {
    let (s, n) = args;
    log s; log n;
}

fn main() {
    task::spawn(("hello from first spawned fn", 65), x);
    task::spawn(("hello from second spawned fn", 66), x);
    task::spawn(("hello from third spawned fn", 67), x);
    let i: int = 30;
    while i > 0 { i = i - 1; log "parent sleeping"; yield(); }
}