@@ -338,7 +338,7 @@ fn each_ancestor(list: &mut AncestorList,
338
338
}
339
339
340
340
// One of these per task.
341
- pub struct TCB {
341
+ pub struct Taskgroup {
342
342
// List of tasks with whose fates this one's is intertwined.
343
343
tasks : TaskGroupArc , // 'none' means the group has failed.
344
344
// Lists of tasks who will kill us if they fail, but whom we won't kill.
@@ -347,12 +347,12 @@ pub struct TCB {
347
347
notifier : Option < AutoNotify > ,
348
348
}
349
349
350
- impl Drop for TCB {
350
+ impl Drop for Taskgroup {
351
351
// Runs on task exit.
352
352
fn drop ( & self ) {
353
353
unsafe {
354
354
// FIXME(#4330) Need self by value to get mutability.
355
- let this: & mut TCB = transmute ( self ) ;
355
+ let this: & mut Taskgroup = transmute ( self ) ;
356
356
357
357
// If we are failing, the whole taskgroup needs to die.
358
358
do RuntimeGlue :: with_task_handle_and_failing |me, failing| {
@@ -382,15 +382,15 @@ impl Drop for TCB {
382
382
}
383
383
}
384
384
385
- pub fn TCB ( tasks : TaskGroupArc ,
385
+ pub fn Taskgroup ( tasks : TaskGroupArc ,
386
386
ancestors : AncestorList ,
387
387
is_main : bool ,
388
- mut notifier : Option < AutoNotify > ) -> TCB {
388
+ mut notifier : Option < AutoNotify > ) -> Taskgroup {
389
389
for notifier . mut_iter( ) . advance |x| {
390
390
x. failed = false;
391
391
}
392
392
393
- TCB {
393
+ Taskgroup {
394
394
tasks : tasks,
395
395
ancestors : ancestors,
396
396
is_main : is_main,
@@ -488,11 +488,11 @@ fn kill_taskgroup(state: TaskGroupInner, me: &TaskHandle, is_main: bool) {
488
488
// FIXME (#2912): Work around core-vs-coretest function duplication. Can't use
489
489
// a proper closure because the #[test]s won't understand. Have to fake it.
490
490
#[ cfg( not( stage0) ) ]
491
- fn taskgroup_key( ) -> local_data:: Key <@@mut TCB > {
491
+ fn taskgroup_key( ) -> local_data:: Key <@@mut Taskgroup > {
492
492
unsafe { cast : : transmute( -2 ) }
493
493
}
494
494
#[ cfg( stage0) ]
495
- fn taskgroup_key( ) -> local_data:: Key <@@mut TCB > {
495
+ fn taskgroup_key( ) -> local_data:: Key <@@mut Taskgroup > {
496
496
unsafe { cast : : transmute( ( -2 , 0 ) ) }
497
497
}
498
498
@@ -540,7 +540,7 @@ impl RuntimeGlue {
540
540
}
541
541
}
542
542
543
- fn with_my_taskgroup < U > ( blk: & fn( & TCB ) -> U ) -> U {
543
+ fn with_my_taskgroup < U > ( blk: & fn( & Taskgroup ) -> U ) -> U {
544
544
match context( ) {
545
545
OldTaskContext => unsafe {
546
546
let me = rt:: rust_get_task ( ) ;
@@ -555,7 +555,8 @@ impl RuntimeGlue {
555
555
descendants : TaskSet :: new ( ) ,
556
556
} ) ) ;
557
557
// Main task/group has no ancestors, no notifier, etc.
558
- let group = @@mut TCB ( tasks, AncestorList ( None ) , true , None ) ;
558
+ let group = @@mut Taskgroup ( tasks, AncestorList ( None ) ,
559
+ true , None ) ;
559
560
local_set ( OldHandle ( me) , taskgroup_key ( ) , group) ;
560
561
blk ( & * * group)
561
562
}
@@ -577,7 +578,7 @@ impl RuntimeGlue {
577
578
members : members,
578
579
descendants : TaskSet :: new ( ) ,
579
580
} ) ) ;
580
- let group = TCB ( tasks, AncestorList ( None ) , true , None ) ;
581
+ let group = Taskgroup ( tasks, AncestorList ( None ) , true , None ) ;
581
582
( * me) . taskgroup = Some ( group) ;
582
583
( * me) . taskgroup . get_ref ( )
583
584
}
@@ -683,7 +684,7 @@ fn spawn_raw_newsched(mut opts: TaskOpts, f: ~fn()) {
683
684
if enlist_many ( NewTask ( handle) , & child_tg, & mut ancestors) {
684
685
// Got in. We can run the provided child body, and can also run
685
686
// the taskgroup's exit-time-destructor afterward.
686
- me. taskgroup = Some ( TCB ( child_tg, ancestors, is_main, None ) ) ;
687
+ me. taskgroup = Some ( Taskgroup ( child_tg, ancestors, is_main, None ) ) ;
687
688
true
688
689
} else {
689
690
false
@@ -781,7 +782,7 @@ fn spawn_raw_oldsched(mut opts: TaskOpts, f: ~fn()) {
781
782
let notifier = notify_chan. map_consume ( |c| AutoNotify ( c) ) ;
782
783
783
784
if enlist_many ( OldTask ( child) , & child_arc, & mut ancestors) {
784
- let group = @@mut TCB ( child_arc, ancestors, is_main, notifier) ;
785
+ let group = @@mut Taskgroup ( child_arc, ancestors, is_main, notifier) ;
785
786
unsafe {
786
787
local_set ( OldHandle ( child) , taskgroup_key ( ) , group) ;
787
788
}
0 commit comments