about summary refs log tree commit diff
path: root/src/libstd/sys_common
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2018-04-04 06:19:40 +0000
committerbors <bors@rust-lang.org>2018-04-04 06:19:40 +0000
commit5758c2dd14fd29caf7c7bb2123eb6b23443b9233 (patch)
tree00119e47d0be6aa30215fd510a06a2fde63dd937 /src/libstd/sys_common
parent20338a52401bda3024fd91010a143913a8dc9a6c (diff)
parent7db854b36f9598e44fb4d61428d42d7769233e19 (diff)
downloadrust-5758c2dd14fd29caf7c7bb2123eb6b23443b9233.tar.gz
rust-5758c2dd14fd29caf7c7bb2123eb6b23443b9233.zip
Auto merge of #48575 - ishitatsuyuki:unix-no-thread, r=alexcrichton
rustc_driver: get rid of the extra thread

**Do not rollup**

We can alter the stack size afterwards on Unix.

Having a separate thread causes poor debugging experience when interrupting with signals. I have to get the backtrace of the all thread, as the main thread is waiting to join doing nothing else. This patch allows me to just run `bt` to get the desired backtrace.
Diffstat (limited to 'src/libstd/sys_common')
-rw-r--r--src/libstd/sys_common/thread_info.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/libstd/sys_common/thread_info.rs b/src/libstd/sys_common/thread_info.rs
index 6a2b6742367..d75cbded734 100644
--- a/src/libstd/sys_common/thread_info.rs
+++ b/src/libstd/sys_common/thread_info.rs
@@ -50,3 +50,7 @@ pub fn set(stack_guard: Option<Guard>, thread: Thread) {
         thread,
     }));
 }
+
+pub fn reset_guard(stack_guard: Option<Guard>) {
+    THREAD_INFO.with(move |c| c.borrow_mut().as_mut().unwrap().stack_guard = stack_guard);
+}