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

Proper record control thread destruction #19

Open
jonnew opened this issue May 26, 2016 · 0 comments
Open

Proper record control thread destruction #19

jonnew opened this issue May 26, 2016 · 0 comments

Comments

@jonnew
Copy link
Owner

jonnew commented May 26, 2016

In oat-record component, destruction of the record control thread requires some custom cleanup. In this case, as per @shlevy in #17

It would probably be better to either a) detach the thread or b) wrap the thread in a class with a destructor that calls cleanup.

Deteaching: downside is that the process won't wait for the thread to finish before exiting, so if there's any cleanup that thread needs to do it's a non-starter.

Having a class with a custom destructor is pretty idiomatic C++ here IMO. Doesn't mean it's the right way to do it, of course, but a big part of the rationale for "terminate on joinable thread destruction" is that it's so easy to get another behavior with your own wrapper.

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

No branches or pull requests

1 participant