diff options
| author | bors <bors@rust-lang.org> | 2013-08-01 12:52:29 -0700 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2013-08-01 12:52:29 -0700 |
| commit | 82b24559e6aa0914f8a49e0a9dbfb3cf35372515 (patch) | |
| tree | c2b0ff9b26400eac3f3405d78fe89dc07607c3ae /src/libstd/task | |
| parent | 479809a267dbbcc3e2ec87da677c63430d3d229a (diff) | |
| parent | 94f1a5d6f8ecd30c6f59dfeaacdd5962f58bc44c (diff) | |
| download | rust-82b24559e6aa0914f8a49e0a9dbfb3cf35372515.tar.gz rust-82b24559e6aa0914f8a49e0a9dbfb3cf35372515.zip | |
auto merge of #8190 : thestinger/rust/for, r=thestinger
Diffstat (limited to 'src/libstd/task')
| -rw-r--r-- | src/libstd/task/mod.rs | 18 | ||||
| -rw-r--r-- | src/libstd/task/spawn.rs | 3 |
2 files changed, 11 insertions, 10 deletions
diff --git a/src/libstd/task/mod.rs b/src/libstd/task/mod.rs index aff4bc12039..d0124407bd4 100644 --- a/src/libstd/task/mod.rs +++ b/src/libstd/task/mod.rs @@ -683,7 +683,7 @@ fn test_spawn_unlinked_unsup_no_fail_down() { // grandchild sends on a port let ch = ch.clone(); do spawn_unlinked { // Give middle task a chance to fail-but-not-kill-us. - for 16.times { task::yield(); } + do 16.times { task::yield(); } ch.send(()); // If killed first, grandparent hangs. } fail!(); // Shouldn't kill either (grand)parent or (grand)child. @@ -698,7 +698,7 @@ fn test_spawn_unlinked_unsup_no_fail_up() { // child unlinked fails fn test_spawn_unlinked_sup_no_fail_up() { // child unlinked fails do spawn_supervised { fail!(); } // Give child a chance to fail-but-not-kill-us. - for 16.times { task::yield(); } + do 16.times { task::yield(); } } #[test] #[should_fail] #[ignore(cfg(windows))] fn test_spawn_unlinked_sup_fail_down() { @@ -760,7 +760,7 @@ fn test_spawn_failure_propagate_grandchild() { do spawn_supervised { do spawn_supervised { block_forever(); } } - for 16.times { task::yield(); } + do 16.times { task::yield(); } fail!(); } @@ -770,7 +770,7 @@ fn test_spawn_failure_propagate_secondborn() { do spawn_supervised { do spawn { block_forever(); } // linked } - for 16.times { task::yield(); } + do 16.times { task::yield(); } fail!(); } @@ -780,7 +780,7 @@ fn test_spawn_failure_propagate_nephew_or_niece() { do spawn { // linked do spawn_supervised { block_forever(); } } - for 16.times { task::yield(); } + do 16.times { task::yield(); } fail!(); } @@ -790,7 +790,7 @@ fn test_spawn_linked_sup_propagate_sibling() { do spawn { // linked do spawn { block_forever(); } // linked } - for 16.times { task::yield(); } + do 16.times { task::yield(); } fail!(); } @@ -970,7 +970,7 @@ fn test_spawn_sched_blocking() { // Testing that a task in one scheduler can block in foreign code // without affecting other schedulers - for 20u.times { + do 20u.times { let (start_po, start_ch) = stream(); let (fin_po, fin_ch) = stream(); @@ -1076,7 +1076,7 @@ fn test_unkillable() { // We want to do this after failing do spawn_unlinked { - for 10.times { yield() } + do 10.times { yield() } ch.send(()); } @@ -1111,7 +1111,7 @@ fn test_unkillable_nested() { // We want to do this after failing do spawn_unlinked || { - for 10.times { yield() } + do 10.times { yield() } ch.send(()); } diff --git a/src/libstd/task/spawn.rs b/src/libstd/task/spawn.rs index 81db5e690a6..4558f8e32c1 100644 --- a/src/libstd/task/spawn.rs +++ b/src/libstd/task/spawn.rs @@ -372,8 +372,9 @@ impl Drop for Taskgroup { // with our own taskgroup, so long as both happen before we die. // We remove ourself from every ancestor we can, so no cleanup; no // break. - for each_ancestor(&mut this.ancestors, |_| {}) |ancestor_group| { + do each_ancestor(&mut this.ancestors, |_| {}) |ancestor_group| { leave_taskgroup(ancestor_group, &me, false); + true }; } } |
