about summary refs log tree commit diff
path: root/src/libstd/rt
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2013-08-01 06:01:39 -0700
committerbors <bors@rust-lang.org>2013-08-01 06:01:39 -0700
commit18d124b9b5dcb9915e5e1489eed81ed6a8b90c39 (patch)
tree08815543f7ba4e527622ab5c654f87b17d91c252 /src/libstd/rt
parent9824d90ffd7684eca7171c4e019fd85b9317904e (diff)
parentbc7cee7bbf816be7a712c06a93015dc3c6fd5611 (diff)
downloadrust-18d124b9b5dcb9915e5e1489eed81ed6a8b90c39.tar.gz
rust-18d124b9b5dcb9915e5e1489eed81ed6a8b90c39.zip
auto merge of #8158 : bblum/rust/task-cleanup, r=brson
r? @brson
Diffstat (limited to 'src/libstd/rt')
-rw-r--r--src/libstd/rt/kill.rs2
-rw-r--r--src/libstd/rt/mod.rs2
-rw-r--r--src/libstd/rt/task.rs10
3 files changed, 10 insertions, 4 deletions
diff --git a/src/libstd/rt/kill.rs b/src/libstd/rt/kill.rs
index e691bf51ea5..c2571f171a1 100644
--- a/src/libstd/rt/kill.rs
+++ b/src/libstd/rt/kill.rs
@@ -84,7 +84,7 @@ pub struct Death {
     on_exit:         Option<~fn(bool)>,
     // nesting level counter for task::unkillable calls (0 == killable).
     unkillable:      int,
-    // nesting level counter for task::atomically calls (0 == can yield).
+    // nesting level counter for unstable::atomically calls (0 == can yield).
     wont_sleep:      int,
     // A "spare" handle to the kill flag inside the kill handle. Used during
     // blocking/waking as an optimization to avoid two xadds on the refcount.
diff --git a/src/libstd/rt/mod.rs b/src/libstd/rt/mod.rs
index 44418001f14..8648832c591 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,
         }
     }