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

Add notify_termination initializers for Windows and Posix. #11

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

nat-goodspeed
Copy link

This pull request depends on #10. That changeset displays as part of this comparison.

This PR provides a high-level feature -- asynchronous child-process termination notification -- using two distinct platform-specific initializers with the same name and signature, permitting portable consumer code.

Originally we simply passed in the hProcess obtained by CreateProcess().
Unfortunately that left the completion callback vulnerable to the business
logic closing the handle, meaning we could not obtain the child process
termination code. Duplicating the handle and passing the duplicate solves that
issue.

Also, the object_handle must survive until its async_wait() call has
called its completion handler. Otherwise the handler is called too soon
(immediately!) while the child process is still running.
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

Successfully merging this pull request may close these issues.

1 participant