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.
Right. If you skip the loop and don't wait on the `worker_control_event` handle, the event won't be reset and thus wake up the next worker thread when the user calls `StartAsync` the second time.