@@ -767,11 +767,11 @@ enum AncestorList = option<unsafe::Exclusive<AncestorNode>>;
767
767
768
768
// Accessors for taskgroup arcs and ancestor arcs that wrap the unsafety.
769
769
#[ inline( always) ]
770
- fn access_group<U >( x: TaskGroupArc , blk: fn ( TaskGroupInner ) -> U ) -> U {
770
+ fn access_group<U >( x: & TaskGroupArc , blk: fn ( TaskGroupInner ) -> U ) -> U {
771
771
unsafe { x. with( blk) }
772
772
}
773
773
#[ inline( always) ]
774
- fn access_ancestors<U >( x: unsafe :: Exclusive <AncestorNode >,
774
+ fn access_ancestors<U >( x: & unsafe :: Exclusive <AncestorNode >,
775
775
blk: fn ( x: & mut AncestorNode ) -> U ) -> U {
776
776
unsafe { x. with( blk) }
777
777
}
@@ -800,7 +800,7 @@ fn each_ancestor(list: &mut AncestorList,
800
800
// Need to swap the list out to use it, to appease borrowck.
801
801
let tmp_list = util:: replace( list, AncestorList ( none) ) ;
802
802
let ( coalesce_this, early_break) =
803
- iterate( tmp_list, bail_opt, forward_blk, last_generation) ;
803
+ iterate( & tmp_list, bail_opt, forward_blk, last_generation) ;
804
804
// What should our next ancestor end up being?
805
805
if coalesce_this. is_some( ) {
806
806
// Needed coalesce. Our next ancestor becomes our old
@@ -821,7 +821,7 @@ fn each_ancestor(list: &mut AncestorList,
821
821
// bool:
822
822
// True if the supplied block did 'break', here or in any recursive
823
823
// calls. If so, must call the unwinder on all previous nodes.
824
- fn iterate( ancestors: AncestorList ,
824
+ fn iterate( ancestors: & AncestorList ,
825
825
bail_opt: option<fn @( TaskGroupInner ) >,
826
826
forward_blk: fn ( TaskGroupInner ) -> bool ,
827
827
last_generation: uint) -> ( option<AncestorList >, bool ) {
@@ -836,9 +836,9 @@ fn each_ancestor(list: &mut AncestorList,
836
836
837
837
// The map defaults to none, because if ancestors is none, we're at
838
838
// the end of the list, which doesn't make sense to coalesce.
839
- return do ( * ancestors) . map_default( ( none, false) ) |ancestor_arc| {
839
+ return do ( * * ancestors) . map_default( ( none, false) ) |ancestor_arc| {
840
840
// NB: Takes a lock! (this ancestor node)
841
- do access_ancestors( ancestor_arc) |nobe| {
841
+ do access_ancestors( & ancestor_arc) |nobe| {
842
842
// Check monotonicity
843
843
assert last_generation > nobe. generation;
844
844
/*##########################################################*
@@ -903,7 +903,7 @@ fn each_ancestor(list: &mut AncestorList,
903
903
blk: fn ( TaskGroupInner ) -> U ) -> U {
904
904
// If this trips, more likely the problem is 'blk' failed inside.
905
905
let tmp_arc = option:: swap_unwrap( parent_group) ;
906
- let result = do access_group( tmp_arc) |tg_opt| { blk( tg_opt) } ;
906
+ let result = do access_group( & tmp_arc) |tg_opt| { blk( tg_opt) } ;
907
907
* parent_group <- some( tmp_arc) ;
908
908
result
909
909
}
@@ -934,12 +934,12 @@ struct Tcb {
934
934
if rustrt:: rust_task_is_unwinding( self . me) {
935
935
self . notifier. iter( |x| { x. failed = true; } ) ;
936
936
// Take everybody down with us.
937
- do access_group( self . tasks) |tg| {
937
+ do access_group( & self . tasks) |tg| {
938
938
kill_taskgroup( tg, self . me, self . is_main) ;
939
939
}
940
940
} else {
941
941
// Remove ourselves from the group(s).
942
- do access_group( self . tasks) |tg| {
942
+ do access_group( & self . tasks) |tg| {
943
943
leave_taskgroup( tg, self . me, true ) ;
944
944
}
945
945
}
@@ -1080,7 +1080,7 @@ fn gen_child_taskgroup(linked: bool, supervised: bool)
1080
1080
// it should be enabled only in debug builds.
1081
1081
let new_generation =
1082
1082
match * old_ancestors {
1083
- some( arc) => access_ancestors( arc, |a| a. generation+1 ) ,
1083
+ some( arc) => access_ancestors( & arc, |a| a. generation+1 ) ,
1084
1084
none => 0 // the actual value doesn't really matter.
1085
1085
} ;
1086
1086
assert new_generation < uint:: max_value;
@@ -1165,7 +1165,7 @@ fn spawn_raw(+opts: TaskOpts, +f: fn~()) {
1165
1165
// send something on the notify channel.
1166
1166
let notifier = notify_chan. map( |c| AutoNotify ( c) ) ;
1167
1167
1168
- if enlist_many( child, child_arc, & mut ancestors) {
1168
+ if enlist_many( child, & child_arc, & mut ancestors) {
1169
1169
let group = @Tcb ( child, child_arc, ancestors,
1170
1170
is_main, notifier) ;
1171
1171
unsafe { local_set( child, taskgroup_key!( ) , group) ; }
@@ -1178,7 +1178,7 @@ fn spawn_raw(+opts: TaskOpts, +f: fn~()) {
1178
1178
// Set up membership in taskgroup and descendantship in all ancestor
1179
1179
// groups. If any enlistment fails, some task was already failing, so
1180
1180
// don't let the child task run, and undo every successful enlistment.
1181
- fn enlist_many( child: * rust_task, child_arc: TaskGroupArc ,
1181
+ fn enlist_many( child: * rust_task, child_arc: & TaskGroupArc ,
1182
1182
ancestors: & mut AncestorList ) -> bool {
1183
1183
// Join this taskgroup.
1184
1184
let mut result =
0 commit comments