From 5368ea7d2eae4e86c1c7a68197506d062bc1689d Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 10 May 2022 02:41:19 -0300 Subject: Expose process main_thread_handle on Windows --- library/std/src/os/windows/process.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'library/std/src/os/windows') diff --git a/library/std/src/os/windows/process.rs b/library/std/src/os/windows/process.rs index e1896309914..1c7e361c2a4 100644 --- a/library/std/src/os/windows/process.rs +++ b/library/std/src/os/windows/process.rs @@ -180,3 +180,17 @@ impl CommandExt for process::Command { self } } + +#[unstable(feature = "windows_process_extensions_main_thread_handle", issue = "96723")] +pub trait ChildExt: Sealed { + /// Extracts the main thread raw handle, without taking ownership + #[unstable(feature = "windows_process_extensions_main_thread_handle", issue = "96723")] + fn main_thread_handle(&self) -> BorrowedHandle<'_>; +} + +#[unstable(feature = "windows_process_extensions_main_thread_handle", issue = "96723")] +impl ChildExt for process::Child { + fn main_thread_handle(&self) -> BorrowedHandle<'_> { + self.handle.main_thread_handle() + } +} -- cgit 1.4.1-3-g733a5