cactusdynamics / cactus-rt

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

Change access to `stop_requested_` #83

Closed marip8 closed 20 hours ago

marip8 commented 4 weeks 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 20 hours 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).