Skip to content

Commit dca49e0

Browse files
committed
Move native thread name setting from thread_info to Thread, fixes #21911
1 parent bfdcd34 commit dca49e0

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/libstd/sys/common/thread_info.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,10 +56,6 @@ pub fn stack_guard() -> uint {
5656

5757
pub fn set(stack_bounds: (uint, uint), stack_guard: uint, thread: Thread) {
5858
THREAD_INFO.with(|c| assert!(c.borrow().is_none()));
59-
match thread.name() {
60-
Some(name) => unsafe { ::sys::thread::set_name(name); },
61-
None => {}
62-
}
6359
THREAD_INFO.with(move |c| *c.borrow_mut() = Some(ThreadInfo{
6460
stack_bounds: stack_bounds,
6561
stack_guard: stack_guard,

src/libstd/thread.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,10 @@ impl Builder {
280280
unsafe {
281281
stack::record_os_managed_stack_bounds(my_stack_bottom, my_stack_top);
282282
}
283+
match their_thread.name() {
284+
Some(name) => unsafe { imp::set_name(name.as_slice()); },
285+
None => {}
286+
}
283287
thread_info::set(
284288
(my_stack_bottom, my_stack_top),
285289
unsafe { imp::guard::current() },

0 commit comments

Comments
 (0)