diff options
| author | Brian Anderson <banderson@mozilla.com> | 2013-08-11 18:54:23 -0700 |
|---|---|---|
| committer | Brian Anderson <banderson@mozilla.com> | 2013-08-19 20:39:39 -0700 |
| commit | 0f9ab936423cfc427ff30e87efc7ca794fec8bcf (patch) | |
| tree | 01a0efa5b80b7440f4eca606e506ea197687a9ab /src/libstd/rt/task.rs | |
| parent | 2ec9b8ce2f08dd9b931bd084f83fd3a4d0c3e8c7 (diff) | |
| download | rust-0f9ab936423cfc427ff30e87efc7ca794fec8bcf.tar.gz rust-0f9ab936423cfc427ff30e87efc7ca794fec8bcf.zip | |
std: Restore dynamic borrow tracking
Diffstat (limited to 'src/libstd/rt/task.rs')
| -rw-r--r-- | src/libstd/rt/task.rs | 18 |
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 |
