From d6b7c96c3eb29b9244ece0c046d3f372ff432d04 Mon Sep 17 00:00:00 2001 From: Graydon Hoare Date: Wed, 23 Jun 2010 21:03:09 -0700 Subject: Populate tree. --- src/test/run-pass/threads.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 src/test/run-pass/threads.rs (limited to 'src/test/run-pass/threads.rs') diff --git a/src/test/run-pass/threads.rs b/src/test/run-pass/threads.rs new file mode 100644 index 00000000..b0fee65f --- /dev/null +++ b/src/test/run-pass/threads.rs @@ -0,0 +1,16 @@ +// -*- rust -*- + +fn main() { + let port[int] p = port(); + let int i = 10; + while (i > 0) { + spawn thread child(i); + i = i - 1; + } + log "main thread exiting"; +} + +fn child(int x) { + log x; +} + -- cgit v1.2.3