From ec4981ece86769c768d61a914093a7a39192522c Mon Sep 17 00:00:00 2001 From: Vojtech Kral Date: Tue, 27 Jan 2015 03:38:07 +0100 Subject: Thread native name setting, fix #10302 --- src/libstd/sys/windows/thread.rs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/libstd/sys/windows') diff --git a/src/libstd/sys/windows/thread.rs b/src/libstd/sys/windows/thread.rs index 30707488b30..b6027ea2e7e 100644 --- a/src/libstd/sys/windows/thread.rs +++ b/src/libstd/sys/windows/thread.rs @@ -67,6 +67,13 @@ pub unsafe fn create(stack: uint, p: Thunk) -> rust_thread { return ret; } +pub unsafe fn set_name(name: &str) { + // Windows threads are nameless + // The names in MSVC debugger are obtained using a "magic" exception, + // which requires a use of C++ macros. + // See https://msdn.microsoft.com/en-us/library/xcb2z8hs.aspx +} + pub unsafe fn join(native: rust_thread) { use libc::consts::os::extra::INFINITE; WaitForSingleObject(native, INFINITE); -- cgit 1.4.1-3-g733a5 From c155208de42de5761231726e35614b4499b5a137 Mon Sep 17 00:00:00 2001 From: Vojtech Kral Date: Tue, 27 Jan 2015 16:00:26 +0100 Subject: Thread native name setting, fix #10302 --- src/libstd/sys/unix/thread.rs | 4 ++-- src/libstd/sys/windows/thread.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src/libstd/sys/windows') diff --git a/src/libstd/sys/unix/thread.rs b/src/libstd/sys/unix/thread.rs index 3c34e1f9dd4..1fba6bedc7c 100644 --- a/src/libstd/sys/unix/thread.rs +++ b/src/libstd/sys/unix/thread.rs @@ -223,9 +223,9 @@ pub unsafe fn set_name(name: &str) { 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) { - // 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()); pthread_setname_np(cname.as_ptr()); } diff --git a/src/libstd/sys/windows/thread.rs b/src/libstd/sys/windows/thread.rs index b6027ea2e7e..a94adcb3bc7 100644 --- a/src/libstd/sys/windows/thread.rs +++ b/src/libstd/sys/windows/thread.rs @@ -67,10 +67,10 @@ pub unsafe fn create(stack: uint, p: Thunk) -> rust_thread { return ret; } -pub unsafe fn set_name(name: &str) { +pub unsafe fn set_name(_name: &str) { // Windows threads are nameless // 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 } -- cgit 1.4.1-3-g733a5