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::os::windows::io::{AsRawHandle, IntoRawHandle, RawHandle};
8use crate::sys_common::{AsInner, IntoInner};
9use crate::thread;
10
11#[stable(feature = "thread_extensions", since = "1.9.0")]
12impl<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")]
20impl<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}