@@ -69,16 +69,16 @@ macro_rules! move_it (
69
69
{ $x: expr } => { unsafe { let y <- * ptr:: addr_of( & ( $x) ) ; move y } }
70
70
)
71
71
72
- pub type TaskSet = send_map:: linear:: LinearMap < * rust_task , ( ) > ;
72
+ type TaskSet = send_map:: linear:: LinearMap < * rust_task , ( ) > ;
73
73
74
- pub fn new_taskset ( ) -> TaskSet {
74
+ fn new_taskset ( ) -> TaskSet {
75
75
send_map:: linear:: LinearMap ( )
76
76
}
77
- pub fn taskset_insert ( tasks : & mut TaskSet , task : * rust_task ) {
77
+ fn taskset_insert ( tasks : & mut TaskSet , task : * rust_task ) {
78
78
let didnt_overwrite = tasks. insert ( task, ( ) ) ;
79
79
assert didnt_overwrite;
80
80
}
81
- pub fn taskset_remove ( tasks : & mut TaskSet , task : * rust_task ) {
81
+ fn taskset_remove ( tasks : & mut TaskSet , task : * rust_task ) {
82
82
let was_present = tasks. remove ( & task) ;
83
83
assert was_present;
84
84
}
@@ -87,20 +87,20 @@ pub fn taskset_each(tasks: &TaskSet, blk: fn(v: *rust_task) -> bool) {
87
87
}
88
88
89
89
// One of these per group of linked-failure tasks.
90
- pub type TaskGroupData = {
90
+ type TaskGroupData = {
91
91
// All tasks which might kill this group. When this is empty, the group
92
92
// can be "GC"ed (i.e., its link in the ancestor list can be removed).
93
93
mut members: TaskSet ,
94
94
// All tasks unidirectionally supervised by (directly or transitively)
95
95
// tasks in this group.
96
96
mut descendants: TaskSet ,
97
97
} ;
98
- pub type TaskGroupArc = private:: Exclusive < Option < TaskGroupData > > ;
98
+ type TaskGroupArc = private:: Exclusive < Option < TaskGroupData > > ;
99
99
100
- pub type TaskGroupInner = & mut Option < TaskGroupData > ;
100
+ type TaskGroupInner = & mut Option < TaskGroupData > ;
101
101
102
102
// A taskgroup is 'dead' when nothing can cause it to fail; only members can.
103
- pub pure fn taskgroup_is_dead ( tg : & TaskGroupData ) -> bool {
103
+ pure fn taskgroup_is_dead ( tg : & TaskGroupData ) -> bool {
104
104
( & tg. members ) . is_empty ( )
105
105
}
106
106
@@ -111,7 +111,7 @@ pub pure fn taskgroup_is_dead(tg: &TaskGroupData) -> bool {
111
111
// taskgroup which was spawned-unlinked. Tasks from intermediate generations
112
112
// have references to the middle of the list; when intermediate generations
113
113
// die, their node in the list will be collected at a descendant's spawn-time.
114
- pub type AncestorNode = {
114
+ type AncestorNode = {
115
115
// Since the ancestor list is recursive, we end up with references to
116
116
// exclusives within other exclusives. This is dangerous business (if
117
117
// circular references arise, deadlock and memory leaks are imminent).
@@ -124,16 +124,16 @@ pub type AncestorNode = {
124
124
// Recursive rest of the list.
125
125
mut ancestors : AncestorList ,
126
126
} ;
127
- pub enum AncestorList = Option < private : : Exclusive < AncestorNode > > ;
127
+ enum AncestorList = Option < private : : Exclusive < AncestorNode > > ;
128
128
129
129
// Accessors for taskgroup arcs and ancestor arcs that wrap the unsafety.
130
130
#[ inline( always) ]
131
- pub fn access_group < U > ( x : & TaskGroupArc , blk : fn ( TaskGroupInner ) -> U ) -> U {
131
+ fn access_group < U > ( x : & TaskGroupArc , blk : fn ( TaskGroupInner ) -> U ) -> U {
132
132
unsafe { x. with ( blk) }
133
133
}
134
134
135
135
#[ inline( always) ]
136
- pub fn access_ancestors < U > ( x : & private:: Exclusive < AncestorNode > ,
136
+ fn access_ancestors < U > ( x : & private:: Exclusive < AncestorNode > ,
137
137
blk : fn ( x : & mut AncestorNode ) -> U ) -> U {
138
138
unsafe { x. with ( blk) }
139
139
}
@@ -146,7 +146,7 @@ pub fn access_ancestors<U>(x: &private::Exclusive<AncestorNode>,
146
146
// (3) As a bonus, coalesces away all 'dead' taskgroup nodes in the list.
147
147
// FIXME(#2190): Change Option<fn@(...)> to Option<fn&(...)>, to save on
148
148
// allocations. Once that bug is fixed, changing the sigil should suffice.
149
- pub fn each_ancestor ( list : & mut AncestorList ,
149
+ fn each_ancestor ( list : & mut AncestorList ,
150
150
bail_opt : Option < fn @( TaskGroupInner ) > ,
151
151
forward_blk : fn ( TaskGroupInner ) -> bool )
152
152
-> bool {
@@ -271,7 +271,7 @@ pub fn each_ancestor(list: &mut AncestorList,
271
271
}
272
272
273
273
// One of these per task.
274
- pub struct TCB {
274
+ struct TCB {
275
275
me : * rust_task ,
276
276
// List of tasks with whose fates this one's is intertwined.
277
277
tasks : TaskGroupArc , // 'none' means the group has failed.
@@ -303,7 +303,7 @@ pub struct TCB {
303
303
}
304
304
}
305
305
306
- pub fn TCB ( me : * rust_task , tasks : TaskGroupArc , ancestors : AncestorList ,
306
+ fn TCB ( me : * rust_task , tasks : TaskGroupArc , ancestors : AncestorList ,
307
307
is_main : bool , notifier : Option < AutoNotify > ) -> TCB {
308
308
309
309
let notifier = move notifier;
@@ -318,7 +318,7 @@ pub fn TCB(me: *rust_task, tasks: TaskGroupArc, ancestors: AncestorList,
318
318
}
319
319
}
320
320
321
- pub struct AutoNotify {
321
+ struct AutoNotify {
322
322
notify_chan : Chan < Notification > ,
323
323
mut failed : bool ,
324
324
drop {
@@ -327,14 +327,14 @@ pub struct AutoNotify {
327
327
}
328
328
}
329
329
330
- pub fn AutoNotify ( chan : Chan < Notification > ) -> AutoNotify {
330
+ fn AutoNotify ( chan : Chan < Notification > ) -> AutoNotify {
331
331
AutoNotify {
332
332
notify_chan : chan,
333
333
failed : true // Un-set above when taskgroup successfully made.
334
334
}
335
335
}
336
336
337
- pub fn enlist_in_taskgroup ( state : TaskGroupInner , me : * rust_task ,
337
+ fn enlist_in_taskgroup ( state : TaskGroupInner , me : * rust_task ,
338
338
is_member : bool ) -> bool {
339
339
let newstate = util:: replace ( state, None ) ;
340
340
// If 'None', the group was failing. Can't enlist.
@@ -350,7 +350,7 @@ pub fn enlist_in_taskgroup(state: TaskGroupInner, me: *rust_task,
350
350
}
351
351
352
352
// NB: Runs in destructor/post-exit context. Can't 'fail'.
353
- pub fn leave_taskgroup ( state : TaskGroupInner , me : * rust_task ,
353
+ fn leave_taskgroup ( state : TaskGroupInner , me : * rust_task ,
354
354
is_member : bool ) {
355
355
let newstate = util:: replace ( state, None ) ;
356
356
// If 'None', already failing and we've already gotten a kill signal.
@@ -363,7 +363,7 @@ pub fn leave_taskgroup(state: TaskGroupInner, me: *rust_task,
363
363
}
364
364
365
365
// NB: Runs in destructor/post-exit context. Can't 'fail'.
366
- pub fn kill_taskgroup ( state : TaskGroupInner , me : * rust_task , is_main : bool ) {
366
+ fn kill_taskgroup ( state : TaskGroupInner , me : * rust_task , is_main : bool ) {
367
367
// NB: We could do the killing iteration outside of the group arc, by
368
368
// having "let mut newstate" here, swapping inside, and iterating after.
369
369
// But that would let other exiting tasks fall-through and exit while we
@@ -405,7 +405,7 @@ macro_rules! taskgroup_key (
405
405
( ) => ( cast:: transmute( ( -2 as uint, 0 u) ) )
406
406
)
407
407
408
- pub fn gen_child_taskgroup ( linked : bool , supervised : bool )
408
+ fn gen_child_taskgroup ( linked : bool , supervised : bool )
409
409
-> ( TaskGroupArc , AncestorList , bool ) {
410
410
let spawner = rt:: rust_get_task ( ) ;
411
411
/*######################################################################*
0 commit comments