Fallout from new thread API

This commit is contained in:
Aaron Turon
2014-12-06 18:34:37 -08:00
parent 14c1a103bc
commit 43ae4b3301
51 changed files with 323 additions and 439 deletions

View File

@@ -8,15 +8,13 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.
use rt::local::Local;
use rt::task::Task;
use rt::util::report_overflow;
use core::prelude::*;
use ptr;
use mem;
use libc;
use libc::types::os::arch::extra::{LPVOID, DWORD, LONG, BOOL};
use sys_common::stack;
use sys_common::{stack, thread_info};
pub struct Handler {
_data: *mut libc::c_void
@@ -37,8 +35,7 @@ impl Drop for Handler {
// guard page doesn't exist. None is returned if there's currently
// no local task.
unsafe fn get_task_guard_page() -> Option<uint> {
let task: Option<*mut Task> = Local::try_unsafe_borrow();
task.map(|task| (&*task).stack_guard().unwrap_or(0))
thread_info::stack_guard()
}
// This is initialized in init() and only read from after