183+ for (auto const platform : platforms)
const&?
123+ if (!state.compare_exchange_strong(expected, State::running))
Close to my EOD (and my brain's somewhat cooked), but the existing code doesn't look threadsafe, and this could still have an interleaving of stop() and start(). I'd guess the start and stop need to be exclusive (maybe a 'start', 'stop' and 'transitioning' state could work). If its also not threadsafe now, could we leave it as is?
183+ for (auto const platform : platforms)
const&?
123+ if (!state. compare_ exchange_ strong( expected, State::running))
Close to my EOD (and my brain's somewhat cooked), but the existing code doesn't look threadsafe, and this could still have an interleaving of stop() and start(). I'd guess the start and stop need to be exclusive (maybe a 'start', 'stop' and 'transitioning' state could work). If its also not threadsafe now, could we leave it as is?