about summary refs log tree commit diff
path: root/src/libcore/task/spawn.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/libcore/task/spawn.rs')
-rw-r--r--src/libcore/task/spawn.rs16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/libcore/task/spawn.rs b/src/libcore/task/spawn.rs
index 9605e4a4356..7b7ec769fa9 100644
--- a/src/libcore/task/spawn.rs
+++ b/src/libcore/task/spawn.rs
@@ -102,11 +102,11 @@ fn new_taskset() -> TaskSet {
 }
 fn taskset_insert(tasks: &mut TaskSet, task: *rust_task) {
     let didnt_overwrite = tasks.insert(task);
-    assert didnt_overwrite;
+    fail_unless!(didnt_overwrite);
 }
 fn taskset_remove(tasks: &mut TaskSet, task: *rust_task) {
     let was_present = tasks.remove(&task);
-    assert was_present;
+    fail_unless!(was_present);
 }
 pub fn taskset_each(tasks: &TaskSet, blk: fn(v: *rust_task) -> bool) {
     tasks.each(|k| blk(*k))
@@ -230,7 +230,7 @@ fn each_ancestor(list:        &mut AncestorList,
             // NB: Takes a lock! (this ancestor node)
             do access_ancestors(ancestor_arc) |nobe| {
                 // Check monotonicity
-                assert last_generation > nobe.generation;
+                fail_unless!(last_generation > nobe.generation);
                 /*##########################################################*
                  * Step 1: Look at this ancestor group (call iterator block).
                  *##########################################################*/
@@ -422,7 +422,7 @@ fn kill_taskgroup(state: TaskGroupInner, me: *rust_task, is_main: bool) {
                 }
             }
             for taskset_each(&group.descendants) |child| {
-                assert child != me;
+                fail_unless!(child != me);
                 rt::rust_task_kill_other(child);
             }
             // Only one task should ever do this.
@@ -497,7 +497,7 @@ fn gen_child_taskgroup(linked: bool, supervised: bool)
                         }
                         None => 0 // the actual value doesn't really matter.
                     };
-                assert new_generation < uint::max_value;
+                fail_unless!(new_generation < uint::max_value);
                 // Build a new node in the ancestor list.
                 AncestorList(Some(unstable::exclusive(AncestorNode {
                     generation: new_generation,
@@ -544,7 +544,7 @@ pub fn spawn_raw(opts: TaskOpts, f: ~fn()) {
                 DefaultScheduler => rt::new_task(),
                 _ => new_task_in_sched(opts.sched)
             };
-            assert !new_task.is_null();
+            fail_unless!(!new_task.is_null());
             // Getting killed after here would leak the task.
             let mut notify_chan = if opts.notify_chan.is_none() {
                 None
@@ -716,7 +716,7 @@ fn test_spawn_raw_notify_success() {
     };
     do spawn_raw(opts) {
     }
-    assert notify_po.recv() == Success;
+    fail_unless!(notify_po.recv() == Success);
 }
 
 #[test]
@@ -733,5 +733,5 @@ fn test_spawn_raw_notify_failure() {
     do spawn_raw(opts) {
         fail!();
     }
-    assert notify_po.recv() == Failure;
+    fail_unless!(notify_po.recv() == Failure);
 }