Skip to content

Commit

Permalink
Small updates to test cases.
Browse files Browse the repository at this point in the history
  • Loading branch information
mbebenita committed Sep 8, 2010
1 parent f8ff013 commit 79e3856
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 3 deletions.
3 changes: 3 additions & 0 deletions src/test/run-fail/task-comm-14.rs
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion src/test/run-pass/task-comm-12.rs
Expand Up @@ -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);
Expand Down
4 changes: 4 additions & 0 deletions src/test/run-pass/task-comm-15.rs
Expand Up @@ -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;
}
3 changes: 1 addition & 2 deletions 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";
Expand Down

0 comments on commit 79e3856

Please sign in to comment.