X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Flibstd%2Fthread.rs;h=cc9d7492441cd86175a138ad7b325c6332d33573;hb=7d2404cb420591588684d4681cf81fe8cff1ace3;hp=eb967c9f4e331f31a9bb5aa88aa7ac5d2f73d179;hpb=bfaa1a8434de3991d9ceae3eea88674a74c5eef2;p=rust.git diff --git a/src/libstd/thread.rs b/src/libstd/thread.rs index eb967c9f4e3..cc9d7492441 100644 --- a/src/libstd/thread.rs +++ b/src/libstd/thread.rs @@ -156,6 +156,7 @@ use option::Option::{self, Some, None}; use result::Result::{Err, Ok}; use sync::{Mutex, Condvar, Arc}; +use str::Str; use string::String; use rt::{self, unwind}; use old_io::{Writer, stdio}; @@ -280,6 +281,10 @@ fn spawn_inner(self, f: Thunk<(), T>, finish: Thunk, ()>) unsafe { 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( (my_stack_bottom, my_stack_top), unsafe { imp::guard::current() },