Skip to content
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

always use the Child to wait? #8

Closed
oconnor663 opened this issue Mar 31, 2017 · 4 comments
Closed

always use the Child to wait? #8

oconnor663 opened this issue Mar 31, 2017 · 4 comments

Comments

@oconnor663
Copy link
Owner

Right now we call waitpid on the side, but we could instead wait with the child itself, once waitid has returned. We'd lose the "try_wait must return Some" sanity check, but we'd gain the ability to return the child back to a caller if we want to.

@oconnor663
Copy link
Owner Author

And of course this will be easier after try_wait lands in libstd (rust-lang/rust#38903). But we can do it now.

@oconnor663
Copy link
Owner Author

An as_mut_ref method wouldn't be safe, because the caller could use that to wait (or swap out the child completely) and we wouldn't know it. But as_ref and into would be ok I think? Would they be useful?

@oconnor663
Copy link
Owner Author

But of course, as_ref isn't possible, because the child is in a Mutex.

@oconnor663
Copy link
Owner Author

Done in 0.3.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant