@@ -320,15 +320,15 @@ fn TCB(me: *rust_task, tasks: TaskGroupArc, ancestors: AncestorList,
320
320
}
321
321
322
322
struct AutoNotify {
323
- notify_chan : Chan < Notification > ,
323
+ notify_chan : Chan < TaskResult > ,
324
324
mut failed : bool ,
325
325
drop {
326
326
let result = if self . failed { Failure } else { Success } ;
327
- self . notify_chan . send ( Exit ( get_task ( ) , result) ) ;
327
+ self . notify_chan . send ( result) ;
328
328
}
329
329
}
330
330
331
- fn AutoNotify ( chan : Chan < Notification > ) -> AutoNotify {
331
+ fn AutoNotify ( chan : Chan < TaskResult > ) -> AutoNotify {
332
332
AutoNotify {
333
333
notify_chan : move chan,
334
334
failed : true // Un-set above when taskgroup successfully made.
@@ -532,7 +532,7 @@ pub fn spawn_raw(opts: TaskOpts, f: fn~()) {
532
532
// (4) ...and runs the provided body function.
533
533
fn make_child_wrapper ( child : * rust_task , child_arc : TaskGroupArc ,
534
534
ancestors : AncestorList , is_main : bool ,
535
- notify_chan : Option < Chan < Notification > > ,
535
+ notify_chan : Option < Chan < TaskResult > > ,
536
536
f : fn ~( ) ) -> fn ~( ) {
537
537
let child_data = ~mut Some ( ( move child_arc, move ancestors) ) ;
538
538
return fn ~( move notify_chan, move child_data, move f) {
@@ -660,36 +660,30 @@ fn test_spawn_raw_unsupervise() {
660
660
#[ test]
661
661
#[ ignore( cfg( windows) ) ]
662
662
fn test_spawn_raw_notify_success ( ) {
663
- let ( task_ch, task_po) = pipes:: stream ( ) ;
664
663
let ( notify_ch, notify_po) = pipes:: stream ( ) ;
665
664
666
665
let opts = {
667
666
notify_chan : Some ( move notify_ch) ,
668
667
.. default_task_opts ( )
669
668
} ;
670
- do spawn_raw( move opts) |move task_ch| {
671
- task_ch. send ( get_task ( ) ) ;
669
+ do spawn_raw( move opts) {
672
670
}
673
- let task_ = task_po. recv ( ) ;
674
- assert notify_po. recv ( ) == Exit ( task_, Success ) ;
671
+ assert notify_po. recv ( ) == Success ;
675
672
}
676
673
677
674
#[ test]
678
675
#[ ignore( cfg( windows) ) ]
679
676
fn test_spawn_raw_notify_failure ( ) {
680
677
// New bindings for these
681
- let ( task_ch, task_po) = pipes:: stream ( ) ;
682
678
let ( notify_ch, notify_po) = pipes:: stream ( ) ;
683
679
684
680
let opts = {
685
681
linked: false,
686
682
notify_chan: Some ( move notify_ch) ,
687
683
.. default_task_opts ( )
688
684
} ;
689
- do spawn_raw( move opts) |move task_ch| {
690
- task_ch. send ( get_task ( ) ) ;
685
+ do spawn_raw( move opts) {
691
686
fail;
692
687
}
693
- let task_ = task_po. recv ( ) ;
694
- assert notify_po. recv ( ) == Exit ( task_, Failure ) ;
688
+ assert notify_po. recv ( ) == Failure ;
695
689
}
0 commit comments