From 698f8c2f01ea549d77d7dc3338a12e04c11057b9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:02:58 +0200 Subject: Adding upstream version 1.64.0+dfsg1. Signed-off-by: Daniel Baumann --- library/std/src/os/windows/thread.rs | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 library/std/src/os/windows/thread.rs (limited to 'library/std/src/os/windows/thread.rs') diff --git a/library/std/src/os/windows/thread.rs b/library/std/src/os/windows/thread.rs new file mode 100644 index 000000000..d81d6d0ac --- /dev/null +++ b/library/std/src/os/windows/thread.rs @@ -0,0 +1,25 @@ +//! Windows-specific extensions to primitives in the [`std::thread`] module. +//! +//! [`std::thread`]: crate::thread + +#![stable(feature = "thread_extensions", since = "1.9.0")] + +use crate::os::windows::io::{AsRawHandle, IntoRawHandle, RawHandle}; +use crate::sys_common::{AsInner, IntoInner}; +use crate::thread; + +#[stable(feature = "thread_extensions", since = "1.9.0")] +impl AsRawHandle for thread::JoinHandle { + #[inline] + fn as_raw_handle(&self) -> RawHandle { + self.as_inner().handle().as_raw_handle() as *mut _ + } +} + +#[stable(feature = "thread_extensions", since = "1.9.0")] +impl IntoRawHandle for thread::JoinHandle { + #[inline] + fn into_raw_handle(self) -> RawHandle { + self.into_inner().into_handle().into_raw_handle() as *mut _ + } +} -- cgit v1.2.3