C++ (Qt)void Master::processAccounts(){ while(true){ QApplication::processEvents(); //If have not resources, then sleep if( !this->accountController->size() ){ QThread::sleep(1); continue; } // Have the resources // Process resources ... };}
C++ (Qt)void Master::processAccounts(){ QEventLoop loop; while(true){ QApplication::processEvents(); if( !this->accountController->size()){ QTimer::singleShot(1000, &loop, SLOT(quit())); loop.exec(); continue; } // Do Pocess ... };}