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

Terminate in destructor #56

Open
klemens-morgenstern opened this issue May 10, 2020 · 0 comments
Open

Terminate in destructor #56

klemens-morgenstern opened this issue May 10, 2020 · 0 comments

Comments

@klemens-morgenstern
Copy link
Contributor

As a trivial example, why we must terminate in the constructor, the following code causes a deadlock if we wait in the destructor.

std::opstream pin:
std::ipstream pout;

std::process proc{"python", std::process_io(pin, pout)};
throw 42;

The python process will wait for the pipe to close (or the exit command), but the pipe will be closed after the process is destruced.

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