about summary refs log tree commit diff
path: root/src/libstd/rt/task.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2013-08-20 06:41:58 -0700
committerbors <bors@rust-lang.org>2013-08-20 06:41:58 -0700
commit7f268128954fef84dcbcb7c9fe77e2a107e0bf69 (patch)
tree9fe3a960ecbe99930486531dfca93a7fb2c8aa25 /src/libstd/rt/task.rs
parent5e9dff90c9d2f6a1ac97a5b121505819f13d86d8 (diff)
parent0f9ab936423cfc427ff30e87efc7ca794fec8bcf (diff)
downloadrust-7f268128954fef84dcbcb7c9fe77e2a107e0bf69.tar.gz
rust-7f268128954fef84dcbcb7c9fe77e2a107e0bf69.zip
auto merge of #8463 : brson/rust/borrowck, r=nmatsakis,nikomatsakis
r? @nikomatsakis
Diffstat (limited to 'src/libstd/rt/task.rs')
-rw-r--r--src/libstd/rt/task.rs18
1 files changed, 14 insertions, 4 deletions
diff --git a/src/libstd/rt/task.rs b/src/libstd/rt/task.rs
index 22d26005078..95d60c11df6 100644
--- a/src/libstd/rt/task.rs
+++ b/src/libstd/rt/task.rs
@@ -20,6 +20,8 @@ use libc::{c_void, uintptr_t};
 use ptr;
 use prelude::*;
 use option::{Option, Some, None};
+use rt::borrowck;
+use rt::borrowck::BorrowRecord;
 use rt::env;
 use rt::kill::Death;
 use rt::local::Local;
@@ -51,7 +53,9 @@ pub struct Task {
     name: Option<~str>,
     coroutine: Option<Coroutine>,
     sched: Option<~Scheduler>,
-    task_type: TaskType
+    task_type: TaskType,
+    // Dynamic borrowck debugging info
+    borrow_list: Option<~[BorrowRecord]>
 }
 
 pub enum TaskType {
@@ -135,7 +139,8 @@ impl Task {
             coroutine: Some(Coroutine::empty()),
             name: None,
             sched: None,
-            task_type: SchedTask
+            task_type: SchedTask,
+            borrow_list: None
         }
     }
 
@@ -168,7 +173,8 @@ impl Task {
             name: None,
             coroutine: Some(Coroutine::new(stack_pool, stack_size, start)),
             sched: None,
-            task_type: GreenTask(Some(~home))
+            task_type: GreenTask(Some(~home)),
+            borrow_list: None
         }
     }
 
@@ -190,7 +196,8 @@ impl Task {
             name: None,
             coroutine: Some(Coroutine::new(stack_pool, stack_size, start)),
             sched: None,
-            task_type: GreenTask(Some(~home))
+            task_type: GreenTask(Some(~home)),
+            borrow_list: None
         }
     }
 
@@ -253,6 +260,9 @@ impl Task {
             }
         }
 
+        // Cleanup the dynamic borrowck debugging info
+        borrowck::clear_task_borrow_list();
+
         // NB. We pass the taskgroup into death so that it can be dropped while
         // the unkillable counter is set. This is necessary for when the
         // taskgroup destruction code drops references on KillHandles, which