]> git.lizzy.rs Git - rust.git/blob - library/std/src/os/windows/thread.rs
Rollup merge of #88706 - ThePuzzlemaker:issue-88609, r=jackh726
[rust.git] / library / std / src / os / windows / thread.rs
1 //! Windows-specific extensions to primitives in the [`std::thread`] module.
2 //!
3 //! [`std::thread`]: crate::thread
4
5 #![stable(feature = "thread_extensions", since = "1.9.0")]
6
7 use crate::os::windows::io::{AsRawHandle, IntoRawHandle, RawHandle};
8 use crate::sys_common::{AsInner, IntoInner};
9 use crate::thread;
10
11 #[stable(feature = "thread_extensions", since = "1.9.0")]
12 impl<T> AsRawHandle for thread::JoinHandle<T> {
13     #[inline]
14     fn as_raw_handle(&self) -> RawHandle {
15         self.as_inner().handle().as_raw_handle() as *mut _
16     }
17 }
18
19 #[stable(feature = "thread_extensions", since = "1.9.0")]
20 impl<T> IntoRawHandle for thread::JoinHandle<T> {
21     #[inline]
22     fn into_raw_handle(self) -> RawHandle {
23         self.into_inner().into_handle().into_raw_handle() as *mut _
24     }
25 }