aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichael Bebenita <[email protected]>2010-09-07 18:01:35 -0700
committerMichael Bebenita <[email protected]>2010-09-07 18:41:07 -0700
commit79e3856d7d4e159eae84093c6b5b5009b121cd8c (patch)
tree862f752a2dfdf613faf59ae919f528f860d15a7e /src
parentAdded a few utility classes, cleaned up the include order of .h files, and st... (diff)
downloadrust-79e3856d7d4e159eae84093c6b5b5009b121cd8c.tar.xz
rust-79e3856d7d4e159eae84093c6b5b5009b121cd8c.zip
Small updates to test cases.
Diffstat (limited to 'src')
-rw-r--r--src/test/run-fail/task-comm-14.rs3
-rw-r--r--src/test/run-pass/task-comm-12.rs2
-rw-r--r--src/test/run-pass/task-comm-15.rs4
-rw-r--r--src/test/run-pass/threads.rs3
4 files changed, 9 insertions, 3 deletions
diff --git a/src/test/run-fail/task-comm-14.rs b/src/test/run-fail/task-comm-14.rs
index f5fa27ac..786f7428 100644
--- a/src/test/run-fail/task-comm-14.rs
+++ b/src/test/run-fail/task-comm-14.rs
@@ -9,6 +9,9 @@ io fn main() {
i = i - 1;
}
+ // Spawned tasks are likely killed before they get a chance to send
+ // anything back, so we deadlock here.
+
i = 10;
let int value = 0;
while (i > 0) {
diff --git a/src/test/run-pass/task-comm-12.rs b/src/test/run-pass/task-comm-12.rs
index ab7c25e8..ceb6ba01 100644
--- a/src/test/run-pass/task-comm-12.rs
+++ b/src/test/run-pass/task-comm-12.rs
@@ -11,7 +11,7 @@ fn start(int task_number) {
fn test00() {
let int i = 0;
- let task t = spawn thread start(i);
+ let task t = spawn thread "child" start(i);
// Sleep long enough for the task to finish.
_task.sleep(10000u);
diff --git a/src/test/run-pass/task-comm-15.rs b/src/test/run-pass/task-comm-15.rs
index 8d748f59..70680e24 100644
--- a/src/test/run-pass/task-comm-15.rs
+++ b/src/test/run-pass/task-comm-15.rs
@@ -9,6 +9,10 @@ io fn start(chan[int] c, int n) {
io fn main() {
let port[int] p = port();
+ // Spawn a task that sends us back messages. The parent task
+ // is likely to terminate before the child completes, so from
+ // the child's point of view the receiver may die. We should
+ // drop messages on the floor in this case, and not crash!
auto child = spawn thread "child" start(chan(p), 10);
auto c <- p;
} \ No newline at end of file
diff --git a/src/test/run-pass/threads.rs b/src/test/run-pass/threads.rs
index b0fee65f..aa6e763f 100644
--- a/src/test/run-pass/threads.rs
+++ b/src/test/run-pass/threads.rs
@@ -1,10 +1,9 @@
// -*- rust -*-
fn main() {
- let port[int] p = port();
let int i = 10;
while (i > 0) {
- spawn thread child(i);
+ spawn thread "child" child(i);
i = i - 1;
}
log "main thread exiting";