diff options
Diffstat (limited to 'src/libcore/task/spawn.rs')
| -rw-r--r-- | src/libcore/task/spawn.rs | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/libcore/task/spawn.rs b/src/libcore/task/spawn.rs index 19c417dfdfc..846d4a34950 100644 --- a/src/libcore/task/spawn.rs +++ b/src/libcore/task/spawn.rs @@ -110,9 +110,14 @@ fn taskset_remove(tasks: &mut TaskSet, task: *rust_task) { let was_present = tasks.remove(&task); assert!(was_present); } +#[cfg(stage0)] pub fn taskset_each(tasks: &TaskSet, blk: &fn(v: *rust_task) -> bool) { tasks.each(|k| blk(*k)) } +#[cfg(not(stage0))] +pub fn taskset_each(tasks: &TaskSet, blk: &fn(v: *rust_task) -> bool) -> bool { + tasks.each(|k| blk(*k)) +} // One of these per group of linked-failure tasks. struct TaskGroupData { @@ -685,13 +690,11 @@ fn spawn_raw_oldsched(mut opts: TaskOpts, f: ~fn()) { }; // Attempt to join every ancestor group. result = - for each_ancestor(ancestors, Some(bail)) |ancestor_tg| { + each_ancestor(ancestors, Some(bail), |ancestor_tg| { // Enlist as a descendant, not as an actual member. // Descendants don't kill ancestor groups on failure. - if !enlist_in_taskgroup(ancestor_tg, child, false) { - break; - } - }; + enlist_in_taskgroup(ancestor_tg, child, false) + }); // If any ancestor group fails, need to exit this group too. if !result { do access_group(child_arc) |child_tg| { |
