From 0f9ab936423cfc427ff30e87efc7ca794fec8bcf Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Sun, 11 Aug 2013 18:54:23 -0700 Subject: std: Restore dynamic borrow tracking --- src/libstd/rt/task.rs | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'src/libstd/rt/task.rs') 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, 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 -- cgit 1.4.1-3-g733a5