about summary refs log tree commit diff
path: root/src/libcore/task/spawn.rs
diff options
context:
space:
mode:
authorBrian Anderson <banderson@mozilla.com>2012-10-22 17:45:20 -0700
committerBrian Anderson <banderson@mozilla.com>2012-10-23 14:21:15 -0700
commitf6d2a7143629898aebea58db836eb2009e97d067 (patch)
tree054a2942983df884dcfc93813c1e7fd887054cf1 /src/libcore/task/spawn.rs
parentb6bde885dc276b2fab3dd0b2de98627dcc304026 (diff)
downloadrust-f6d2a7143629898aebea58db836eb2009e97d067.tar.gz
rust-f6d2a7143629898aebea58db836eb2009e97d067.zip
core: Remove the unused Notification enum
Diffstat (limited to 'src/libcore/task/spawn.rs')
-rw-r--r--src/libcore/task/spawn.rs22
1 files changed, 8 insertions, 14 deletions
diff --git a/src/libcore/task/spawn.rs b/src/libcore/task/spawn.rs
index 6fbb572df41..ea66776d22d 100644
--- a/src/libcore/task/spawn.rs
+++ b/src/libcore/task/spawn.rs
@@ -320,15 +320,15 @@ fn TCB(me: *rust_task, tasks: TaskGroupArc, ancestors: AncestorList,
 }
 
 struct AutoNotify {
-    notify_chan: Chan<Notification>,
+    notify_chan: Chan<TaskResult>,
     mut failed:  bool,
     drop {
         let result = if self.failed { Failure } else { Success };
-        self.notify_chan.send(Exit(get_task(), result));
+        self.notify_chan.send(result);
     }
 }
 
-fn AutoNotify(chan: Chan<Notification>) -> AutoNotify {
+fn AutoNotify(chan: Chan<TaskResult>) -> AutoNotify {
     AutoNotify {
         notify_chan: move chan,
         failed: true // Un-set above when taskgroup successfully made.
@@ -532,7 +532,7 @@ pub fn spawn_raw(opts: TaskOpts, f: fn~()) {
     // (4) ...and runs the provided body function.
     fn make_child_wrapper(child: *rust_task, child_arc: TaskGroupArc,
                           ancestors: AncestorList, is_main: bool,
-                          notify_chan: Option<Chan<Notification>>,
+                          notify_chan: Option<Chan<TaskResult>>,
                           f: fn~()) -> fn~() {
         let child_data = ~mut Some((move child_arc, move ancestors));
         return fn~(move notify_chan, move child_data, move f) {
@@ -660,25 +660,21 @@ fn test_spawn_raw_unsupervise() {
 #[test]
 #[ignore(cfg(windows))]
 fn test_spawn_raw_notify_success() {
-    let (task_ch, task_po) = pipes::stream();
     let (notify_ch, notify_po) = pipes::stream();
 
     let opts = {
         notify_chan: Some(move notify_ch),
         .. default_task_opts()
     };
-    do spawn_raw(move opts) |move task_ch| {
-        task_ch.send(get_task());
+    do spawn_raw(move opts) {
     }
-    let task_ = task_po.recv();
-    assert notify_po.recv() == Exit(task_, Success);
+    assert notify_po.recv() == Success;
 }
 
 #[test]
 #[ignore(cfg(windows))]
 fn test_spawn_raw_notify_failure() {
     // New bindings for these
-    let (task_ch, task_po) = pipes::stream();
     let (notify_ch, notify_po) = pipes::stream();
 
     let opts = {
@@ -686,10 +682,8 @@ fn test_spawn_raw_notify_failure() {
         notify_chan: Some(move notify_ch),
         .. default_task_opts()
     };
-    do spawn_raw(move opts) |move task_ch| {
-        task_ch.send(get_task());
+    do spawn_raw(move opts) {
         fail;
     }
-    let task_ = task_po.recv();
-    assert notify_po.recv() == Exit(task_, Failure);
+    assert notify_po.recv() == Failure;
 }