]> git.lizzy.rs Git - rust.git/blobdiff - src/libstd/sys/windows/thread.rs
Thread native name setting, fix #10302
[rust.git] / src / libstd / sys / windows / thread.rs
index 59ab5f5c4d990b776f2741ae6af69e134aff1dfd..b6027ea2e7e8e42b1942b6b235b85cf69c6e5ca6 100644 (file)
@@ -8,6 +8,8 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+use core::prelude::*;
+
 use boxed::Box;
 use cmp;
 use mem;
@@ -60,11 +62,18 @@ pub unsafe fn create(stack: uint, p: Thunk) -> rust_thread {
     if ret as uint == 0 {
         // be sure to not leak the closure
         let _p: Box<Thunk> = mem::transmute(arg);
-        panic!("failed to spawn native thread: {}", ret);
+        panic!("failed to spawn native thread: {:?}", ret);
     }
     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);