Skip to content

Commit 2183145

Browse files
committed
Rename TCB to Taskgroup
1 parent f3c79c4 commit 2183145

File tree

2 files changed

+16
-15
lines changed

2 files changed

+16
-15
lines changed

src/libstd/rt/task.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ use super::local_heap::LocalHeap;
2727
use rt::sched::{Scheduler, SchedHandle};
2828
use rt::stack::{StackSegment, StackPool};
2929
use rt::context::Context;
30-
use task::spawn::TCB;
30+
use task::spawn::Taskgroup;
3131
use cell::Cell;
3232

3333
pub struct Task {
@@ -37,7 +37,7 @@ pub struct Task {
3737
logger: StdErrLogger,
3838
unwinder: Unwinder,
3939
home: Option<SchedHome>,
40-
taskgroup: Option<TCB>,
40+
taskgroup: Option<Taskgroup>,
4141
death: Death,
4242
destroyed: bool,
4343
coroutine: Option<~Coroutine>

src/libstd/task/spawn.rs

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ fn each_ancestor(list: &mut AncestorList,
338338
}
339339

340340
// One of these per task.
341-
pub struct TCB {
341+
pub struct Taskgroup {
342342
// List of tasks with whose fates this one's is intertwined.
343343
tasks: TaskGroupArc, // 'none' means the group has failed.
344344
// Lists of tasks who will kill us if they fail, but whom we won't kill.
@@ -347,12 +347,12 @@ pub struct TCB {
347347
notifier: Option<AutoNotify>,
348348
}
349349

350-
impl Drop for TCB {
350+
impl Drop for Taskgroup {
351351
// Runs on task exit.
352352
fn drop(&self) {
353353
unsafe {
354354
// FIXME(#4330) Need self by value to get mutability.
355-
let this: &mut TCB = transmute(self);
355+
let this: &mut Taskgroup = transmute(self);
356356

357357
// If we are failing, the whole taskgroup needs to die.
358358
do RuntimeGlue::with_task_handle_and_failing |me, failing| {
@@ -382,15 +382,15 @@ impl Drop for TCB {
382382
}
383383
}
384384

385-
pub fn TCB(tasks: TaskGroupArc,
385+
pub fn Taskgroup(tasks: TaskGroupArc,
386386
ancestors: AncestorList,
387387
is_main: bool,
388-
mut notifier: Option<AutoNotify>) -> TCB {
388+
mut notifier: Option<AutoNotify>) -> Taskgroup {
389389
for notifier.mut_iter().advance |x| {
390390
x.failed = false;
391391
}
392392

393-
TCB {
393+
Taskgroup {
394394
tasks: tasks,
395395
ancestors: ancestors,
396396
is_main: is_main,
@@ -488,11 +488,11 @@ fn kill_taskgroup(state: TaskGroupInner, me: &TaskHandle, is_main: bool) {
488488
// FIXME (#2912): Work around core-vs-coretest function duplication. Can't use
489489
// a proper closure because the #[test]s won't understand. Have to fake it.
490490
#[cfg(not(stage0))]
491-
fn taskgroup_key() -> local_data::Key<@@mut TCB> {
491+
fn taskgroup_key() -> local_data::Key<@@mut Taskgroup> {
492492
unsafe { cast::transmute(-2) }
493493
}
494494
#[cfg(stage0)]
495-
fn taskgroup_key() -> local_data::Key<@@mut TCB> {
495+
fn taskgroup_key() -> local_data::Key<@@mut Taskgroup> {
496496
unsafe { cast::transmute((-2, 0)) }
497497
}
498498

@@ -540,7 +540,7 @@ impl RuntimeGlue {
540540
}
541541
}
542542

543-
fn with_my_taskgroup<U>(blk: &fn(&TCB) -> U) -> U {
543+
fn with_my_taskgroup<U>(blk: &fn(&Taskgroup) -> U) -> U {
544544
match context() {
545545
OldTaskContext => unsafe {
546546
let me = rt::rust_get_task();
@@ -555,7 +555,8 @@ impl RuntimeGlue {
555555
descendants: TaskSet::new(),
556556
}));
557557
// 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);
559560
local_set(OldHandle(me), taskgroup_key(), group);
560561
blk(&**group)
561562
}
@@ -577,7 +578,7 @@ impl RuntimeGlue {
577578
members: members,
578579
descendants: TaskSet::new(),
579580
}));
580-
let group = TCB(tasks, AncestorList(None), true, None);
581+
let group = Taskgroup(tasks, AncestorList(None), true, None);
581582
(*me).taskgroup = Some(group);
582583
(*me).taskgroup.get_ref()
583584
}
@@ -683,7 +684,7 @@ fn spawn_raw_newsched(mut opts: TaskOpts, f: ~fn()) {
683684
if enlist_many(NewTask(handle), &child_tg, &mut ancestors) {
684685
// Got in. We can run the provided child body, and can also run
685686
// 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));
687688
true
688689
} else {
689690
false
@@ -781,7 +782,7 @@ fn spawn_raw_oldsched(mut opts: TaskOpts, f: ~fn()) {
781782
let notifier = notify_chan.map_consume(|c| AutoNotify(c));
782783

783784
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);
785786
unsafe {
786787
local_set(OldHandle(child), taskgroup_key(), group);
787788
}

0 commit comments

Comments
 (0)