about summary refs log tree commit diff
path: root/src/libstd/task
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstd/task')
-rw-r--r--src/libstd/task/mod.rs18
-rw-r--r--src/libstd/task/spawn.rs3
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
                 };
             }
         }