Skip to main content

std/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
7use crate::macros::rustdoc_skip_body;
8use crate::os::windows::io::{AsRawHandle, IntoRawHandle, RawHandle};
9use crate::sys::{AsInner, IntoInner};
10use crate::thread;
11
12#[stable(feature = "thread_extensions", since = "1.9.0")]
13impl<T> AsRawHandle for thread::JoinHandle<T> {
14    #[inline]
15    #[rustdoc_skip_body]
16    fn as_raw_handle(&self) -> RawHandle {
17        self.as_inner().handle().as_raw_handle() as *mut _
18    }
19}
20
21#[stable(feature = "thread_extensions", since = "1.9.0")]
22impl<T> IntoRawHandle for thread::JoinHandle<T> {
23    #[inline]
24    #[rustdoc_skip_body]
25    fn into_raw_handle(self) -> RawHandle {
26        self.into_inner().into_handle().into_raw_handle() as *mut _
27    }
28}