On Wed Jan 11 17:00:57 2023 +0000, Rémi Bernon wrote:
I think you can assume running is true on first iteration, then you should get an event notification if it's been stopped already, and read it from within the CS in a single place. You can also maybe change this to a `do {} while(running)` loop too.
Assuming `worker_control_event` is used purely for notifcation or wake-up and the thread never has to reset or wait on the event, I think it makes more sense to change it into a `for (;;)` loop, and move the running/paused check to the start of the loop.