about summary refs log tree commit diff
path: root/library/std/src/os
diff options
context:
space:
mode:
authorunknown <abramlujan@gmail.com>2022-05-10 02:41:19 -0300
committerunknown <abramlujan@gmail.com>2022-05-10 02:41:19 -0300
commit5368ea7d2eae4e86c1c7a68197506d062bc1689d (patch)
tree57e63729d7bae198d015857768da064b886364e4 /library/std/src/os
parent0dd7e10282aaa7a3e1f5660f8bb043ee4ea07355 (diff)
downloadrust-5368ea7d2eae4e86c1c7a68197506d062bc1689d.tar.gz
rust-5368ea7d2eae4e86c1c7a68197506d062bc1689d.zip
Expose process main_thread_handle on Windows
Diffstat (limited to 'library/std/src/os')
-rw-r--r--library/std/src/os/windows/process.rs14
1 files changed, 14 insertions, 0 deletions
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()
+    }
+}