Thread native name setting, fix #10302

This commit is contained in:
Vojtech Kral 2015-01-27 16:00:26 +01:00
parent ec4981ece8
commit c155208de4
2 changed files with 4 additions and 4 deletions

View File

@ -223,9 +223,9 @@ pub unsafe fn set_name(name: &str) {
pthread_set_name_np(pthread_self(), cname.as_ptr()); pthread_set_name_np(pthread_self(), cname.as_ptr());
} }
#[cfg(target_os = "macos")] #[cfg(any(target_os = "macos", target_os = "ios"))]
pub unsafe fn set_name(name: &str) { pub unsafe fn set_name(name: &str) {
// pthread_setname_np() since OS X 10.6 // pthread_setname_np() since OS X 10.6 and iOS 3.2
let cname = CString::from_slice(name.as_bytes()); let cname = CString::from_slice(name.as_bytes());
pthread_setname_np(cname.as_ptr()); pthread_setname_np(cname.as_ptr());
} }

View File

@ -67,10 +67,10 @@ pub unsafe fn create(stack: uint, p: Thunk) -> rust_thread {
return ret; return ret;
} }
pub unsafe fn set_name(name: &str) { pub unsafe fn set_name(_name: &str) {
// Windows threads are nameless // Windows threads are nameless
// The names in MSVC debugger are obtained using a "magic" exception, // The names in MSVC debugger are obtained using a "magic" exception,
// which requires a use of C++ macros. // which requires a use of MS C++ extensions.
// See https://msdn.microsoft.com/en-us/library/xcb2z8hs.aspx // See https://msdn.microsoft.com/en-us/library/xcb2z8hs.aspx
} }