cactusdynamics / cactus-rt

A C++ framework for programming real-time applications
Mozilla Public License 2.0
185 stars 24 forks source link

Change access to `stop_requested_` #83

Closed marip8 closed 4 months ago

marip8 commented 5 months ago

I have a use-case where I want to be able to start, stop and restart a thread before ultimately joining it. This is not currently possible because there is no way to reset stop_requested_ to true. This PR moves stop_requested_ to the protected section to allow overriding classes to reset its value at the desired place (e.g., in AfterRun)

shuhaowu commented 4 months ago

Hey sorry I can't merge this as is. As it stands, with how the tracing works, a single thread object is not designed to be restarted. It may be possible to patch it to make it work, but there will likely be unintended side effects due to how thread tracers are handled (based on refactoring).