void ThreadWrapper::threadFunc(){ while (!done) doWork(); emit workFinished();}
void WorkerThread::run(){ while (!isInterruptionRequested()) { while (hasSomethingToDo()) doWork(); Q_EMIT notingToDo(); while (!hasSomethingToDo() && !isInterruptionRequested()) sleep(1); }}
while (!done) // while (hasSomethingToDo()) doWork(); <-- пробой emit workFinished();
C++ (Qt)thread->eventDispatcher()->processEvents( QEventLoop::AllEvents )
C++ (Qt)// main threadfor (...) { ... if (..) emit SignalDoSomething(options); // QThreadPool::addTask(options) ..} waitForDone();
C++ (Qt)void waitForDone( void ){ while (m_taskCount) QThread::msleep(2);}