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

AuxTask classes require proper cleanup #400

Open
giuliomoro opened this issue Apr 5, 2018 · 0 comments
Open

AuxTask classes require proper cleanup #400

giuliomoro opened this issue Apr 5, 2018 · 0 comments

Comments

@giuliomoro
Copy link
Contributor

giuliomoro commented Apr 5, 2018

When the destructor is called, it should stop the thread and then (wrap_)pthread_join before it starts destroying anything.

For NonRt, this could be achieved with either:

  • a "fake" __wrap_sendto() just in order to unblock the thread so that it can break the loop
  • using timed select() before read() in the non-rt thread so that every so often it checks for the condition and breaks the loop ( see e.g.: core/Midi.cpp)

The former approach is probably better - if it works - as it would save the timeout-ed wakeups due to using select(), thought this is not critical (we are talking timeouts in the 50-100ms range, so no huge CPU load).

There is some commented-out code in AuxTaskNonRt::cleanup() that could be used as a starting point, though it was causing problems.

@giuliomoro giuliomoro added this to Library classes in Proper library classes Apr 6, 2018
LBDonovan added a commit that referenced this issue Apr 9, 2018
giuliomoro pushed a commit that referenced this issue Nov 9, 2018
@giuliomoro giuliomoro reopened this Oct 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Proper library classes
Library classes
Development

No branches or pull requests

1 participant