about summary refs log tree commit diff
path: root/src/libstd/rt
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstd/rt')
-rw-r--r--src/libstd/rt/mod.rs2
-rw-r--r--src/libstd/rt/task.rs10
2 files changed, 9 insertions, 3 deletions
diff --git a/src/libstd/rt/mod.rs b/src/libstd/rt/mod.rs
index dc8669b9264..c38b929a6ce 100644
--- a/src/libstd/rt/mod.rs
+++ b/src/libstd/rt/mod.rs
@@ -316,12 +316,14 @@ fn run_(main: ~fn(), use_main_sched: bool) -> int {
             // Just put an unpinned task onto one of the default schedulers.
             let mut main_task = ~Task::new_root(&mut scheds[0].stack_pool, main);
             main_task.death.on_exit = Some(on_exit);
+            main_task.name = Some(~"main");
             scheds[0].enqueue_task(main_task);
         }
         Some(ref mut main_sched) => {
             let home = Sched(main_sched.make_handle());
             let mut main_task = ~Task::new_root_homed(&mut scheds[0].stack_pool, home, main);
             main_task.death.on_exit = Some(on_exit);
+            main_task.name = Some(~"main");
             main_sched.enqueue_task(main_task);
         }
     };
diff --git a/src/libstd/rt/task.rs b/src/libstd/rt/task.rs
index 82d4f8fcc04..c1b799796d1 100644
--- a/src/libstd/rt/task.rs
+++ b/src/libstd/rt/task.rs
@@ -40,7 +40,9 @@ pub struct Task {
     taskgroup: Option<Taskgroup>,
     death: Death,
     destroyed: bool,
-    coroutine: Option<~Coroutine>
+    coroutine: Option<~Coroutine>,
+    // FIXME(#6874/#7599) use StringRef to save on allocations
+    name: Option<~str>,
 }
 
 pub struct Coroutine {
@@ -90,7 +92,8 @@ impl Task {
             taskgroup: None,
             death: Death::new(),
             destroyed: false,
-            coroutine: Some(~Coroutine::new(stack_pool, start))
+            coroutine: Some(~Coroutine::new(stack_pool, start)),
+            name: None,
         }
     }
 
@@ -109,7 +112,8 @@ impl Task {
             // FIXME(#7544) make watching optional
             death: self.death.new_child(),
             destroyed: false,
-            coroutine: Some(~Coroutine::new(stack_pool, start))
+            coroutine: Some(~Coroutine::new(stack_pool, start)),
+            name: None,
         }
     }