Move native thread name setting from thread_info to Thread, fixes #21911
This commit is contained in:
@@ -56,10 +56,6 @@ pub fn stack_guard() -> uint {
|
|||||||
|
|
||||||
pub fn set(stack_bounds: (uint, uint), stack_guard: uint, thread: Thread) {
|
pub fn set(stack_bounds: (uint, uint), stack_guard: uint, thread: Thread) {
|
||||||
THREAD_INFO.with(|c| assert!(c.borrow().is_none()));
|
THREAD_INFO.with(|c| assert!(c.borrow().is_none()));
|
||||||
match thread.name() {
|
|
||||||
Some(name) => unsafe { ::sys::thread::set_name(name); },
|
|
||||||
None => {}
|
|
||||||
}
|
|
||||||
THREAD_INFO.with(move |c| *c.borrow_mut() = Some(ThreadInfo{
|
THREAD_INFO.with(move |c| *c.borrow_mut() = Some(ThreadInfo{
|
||||||
stack_bounds: stack_bounds,
|
stack_bounds: stack_bounds,
|
||||||
stack_guard: stack_guard,
|
stack_guard: stack_guard,
|
||||||
|
|||||||
@@ -280,6 +280,10 @@ impl Builder {
|
|||||||
unsafe {
|
unsafe {
|
||||||
stack::record_os_managed_stack_bounds(my_stack_bottom, my_stack_top);
|
stack::record_os_managed_stack_bounds(my_stack_bottom, my_stack_top);
|
||||||
}
|
}
|
||||||
|
match their_thread.name() {
|
||||||
|
Some(name) => unsafe { imp::set_name(name.as_slice()); },
|
||||||
|
None => {}
|
||||||
|
}
|
||||||
thread_info::set(
|
thread_info::set(
|
||||||
(my_stack_bottom, my_stack_top),
|
(my_stack_bottom, my_stack_top),
|
||||||
unsafe { imp::guard::current() },
|
unsafe { imp::guard::current() },
|
||||||
|
|||||||
Reference in New Issue
Block a user