Skip to content

Commit c155208

Browse files
committed
Thread native name setting, fix #10302
1 parent ec4981e commit c155208

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/libstd/sys/unix/thread.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,9 +223,9 @@ pub unsafe fn set_name(name: &str) {
223223
pthread_set_name_np(pthread_self(), cname.as_ptr());
224224
}
225225

226-
#[cfg(target_os = "macos")]
226+
#[cfg(any(target_os = "macos", target_os = "ios"))]
227227
pub unsafe fn set_name(name: &str) {
228-
// pthread_setname_np() since OS X 10.6
228+
// pthread_setname_np() since OS X 10.6 and iOS 3.2
229229
let cname = CString::from_slice(name.as_bytes());
230230
pthread_setname_np(cname.as_ptr());
231231
}

src/libstd/sys/windows/thread.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,10 @@ pub unsafe fn create(stack: uint, p: Thunk) -> rust_thread {
6767
return ret;
6868
}
6969

70-
pub unsafe fn set_name(name: &str) {
70+
pub unsafe fn set_name(_name: &str) {
7171
// Windows threads are nameless
7272
// The names in MSVC debugger are obtained using a "magic" exception,
73-
// which requires a use of C++ macros.
73+
// which requires a use of MS C++ extensions.
7474
// See https://msdn.microsoft.com/en-us/library/xcb2z8hs.aspx
7575
}
7676

0 commit comments

Comments
 (0)