C++ (Qt)void Thread::step(){ for (bool flag = true; flag;) { flag = false; for (Worker *worker : m_workers) { if (worker->isStepReady()) { worker->step(); yieldCurrentThread(); flag = true; }; } }}