Open
Description
how about make main_thread_handle as Option?
Except creating a child process, it is difficult for us to get the main_thread_handle of another process. If we make this item Option, we could extend struct Process's use case. Such as building a process manager, which holds some process's handle without main_thread_handle.
pub struct Process {
handle: Handle,
main_thread_handle: Option<Handle>,
}
impl Process {
...
pub fn main_thread_handle(&self) -> Option<BorrowedHandle<'_>> {
self.main_thread_handle?.as_handle()
}
...
}
Maybe related to #96723