]> git.proxmox.com Git - rustc.git/blob - library/std/src/sys/windows/ext/thread.rs
New upstream version 1.53.0+dfsg1
[rustc.git] / library / std / src / sys / windows / ext / thread.rs
1 //! Extensions to `std::thread` for Windows.
2
3 #![stable(feature = "thread_extensions", since = "1.9.0")]
4
5 use crate::os::windows::io::{AsRawHandle, IntoRawHandle, RawHandle};
6 use crate::sys_common::{AsInner, IntoInner};
7 use crate::thread;
8
9 #[stable(feature = "thread_extensions", since = "1.9.0")]
10 impl<T> AsRawHandle for thread::JoinHandle<T> {
11 #[inline]
12 fn as_raw_handle(&self) -> RawHandle {
13 self.as_inner().handle().raw() as *mut _
14 }
15 }
16
17 #[stable(feature = "thread_extensions", since = "1.9.0")]
18 impl<T> IntoRawHandle for thread::JoinHandle<T> {
19 #[inline]
20 fn into_raw_handle(self) -> RawHandle {
21 self.into_inner().into_handle().into_raw() as *mut _
22 }
23 }