diff options
| author | Vojtech Kral <vojtech@kral.hk> | 2015-01-28 13:48:27 +0100 |
|---|---|---|
| committer | Vojtech Kral <vojtech@kral.hk> | 2015-01-28 13:48:27 +0100 |
| commit | 33a3d6d88f76bfae770983ee50e36e23cc4c7655 (patch) | |
| tree | ec8874adf445589951286bc64619d27462c3709d /src/libstd/sys/common | |
| parent | c155208de42de5761231726e35614b4499b5a137 (diff) | |
| download | rust-33a3d6d88f76bfae770983ee50e36e23cc4c7655.tar.gz rust-33a3d6d88f76bfae770983ee50e36e23cc4c7655.zip | |
Thread native name setting, fix #10302
Diffstat (limited to 'src/libstd/sys/common')
| -rw-r--r-- | src/libstd/sys/common/thread_info.rs | 4 |
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 92b936e74f6..7c9758ca924 100644 --- a/src/libstd/sys/common/thread_info.rs +++ b/src/libstd/sys/common/thread_info.rs @@ -56,6 +56,10 @@ pub fn stack_guard() -> uint { pub fn set(stack_bounds: (uint, uint), stack_guard: uint, thread: Thread) { THREAD_INFO.with(|c| assert!(c.borrow().is_none())); + match thread.name() { + Some(name) => unsafe { ::sys::thread::set_name(name.as_slice()); }, + None => {} + } THREAD_INFO.with(move |c| *c.borrow_mut() = Some(ThreadInfo{ stack_bounds: stack_bounds, stack_guard: stack_guard, |
