diff options
| author | bors <bors@rust-lang.org> | 2018-02-04 22:58:10 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2018-02-04 22:58:10 +0000 |
| commit | e7e982ac03b496dd4d4b5c182fdcd5fb4f2b5470 (patch) | |
| tree | 3495f1e9721731384fae0e1c2a6209fd1402a76f /src/libstd/sys_common/thread_info.rs | |
| parent | 0c6091fbd0eee290c651f73be899f221eeab3c05 (diff) | |
| parent | e17ebdf344401c265ade3b02bb68df0d0485d71a (diff) | |
| download | rust-e7e982ac03b496dd4d4b5c182fdcd5fb4f2b5470.tar.gz rust-e7e982ac03b496dd4d4b5c182fdcd5fb4f2b5470.zip | |
Auto merge of #47998 - kennytm:rollup, r=kennytm
Rollup of 10 pull requests - Successful merges: #47862, #47877, #47896, #47912, #47947, #47958, #47978, #47996, #47999, #47892 - Failed merges:
Diffstat (limited to 'src/libstd/sys_common/thread_info.rs')
| -rw-r--r-- | src/libstd/sys_common/thread_info.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/libstd/sys_common/thread_info.rs b/src/libstd/sys_common/thread_info.rs index 7970042b1d6..6a2b6742367 100644 --- a/src/libstd/sys_common/thread_info.rs +++ b/src/libstd/sys_common/thread_info.rs @@ -11,10 +11,11 @@ #![allow(dead_code)] // stack_guard isn't used right now on all platforms use cell::RefCell; +use sys::thread::guard::Guard; use thread::Thread; struct ThreadInfo { - stack_guard: Option<usize>, + stack_guard: Option<Guard>, thread: Thread, } @@ -38,11 +39,11 @@ pub fn current_thread() -> Option<Thread> { ThreadInfo::with(|info| info.thread.clone()) } -pub fn stack_guard() -> Option<usize> { - ThreadInfo::with(|info| info.stack_guard).and_then(|o| o) +pub fn stack_guard() -> Option<Guard> { + ThreadInfo::with(|info| info.stack_guard.clone()).and_then(|o| o) } -pub fn set(stack_guard: Option<usize>, thread: Thread) { +pub fn set(stack_guard: Option<Guard>, thread: Thread) { THREAD_INFO.with(|c| assert!(c.borrow().is_none())); THREAD_INFO.with(move |c| *c.borrow_mut() = Some(ThreadInfo{ stack_guard, |
