-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Shared exe-unit process module #3168
Conversation
cd2223f
to
a059e97
Compare
a059e97
to
59eb7c2
Compare
} | ||
|
||
impl ProcessHandle { | ||
pub fn new(command: &mut Command) -> Result<ProcessHandle> { | ||
let process = Arc::new(SharedChild::spawn(command)?); | ||
#[cfg(windows)] | ||
let job_object = JobObject::try_new_current()?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left new_process_group
unimplemented for Windows. process_group
is roughly equivalent of Windows JobObject, but new_process_group
is implemented for Command
and I needed to store job_object
somewhere, I could not extend Command
, so instead I just crate job_object
while creating ProcessHandle
.
#[allow(unused)] | ||
#[cfg(windows)] | ||
job_object: JobObject, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Having conditionally existing field is hard to maintain. I'm wondering if we could have empty job object implementation for unix?
In general all these conditional compilation in process handling is hard to maintain, because we need to compile with different features to be sure it will compile... But it was already done like this before, so we can leave it as is if it would require to much work.
Resolves: #3167