X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Flibstd%2Fsys%2Fwindows%2Fthread.rs;h=b6027ea2e7e8e42b1942b6b235b85cf69c6e5ca6;hb=ec4981ece86769c768d61a914093a7a39192522c;hp=59ab5f5c4d990b776f2741ae6af69e134aff1dfd;hpb=520cdcb79a40b4403092759633d6ed77a7c0e3ac;p=rust.git diff --git a/src/libstd/sys/windows/thread.rs b/src/libstd/sys/windows/thread.rs index 59ab5f5c4d9..b6027ea2e7e 100644 --- a/src/libstd/sys/windows/thread.rs +++ b/src/libstd/sys/windows/thread.rs @@ -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 = 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);