C++ (Qt)void AutoThreadObj::process(){ forever { m_mutex->lock(); m_condition->wait(m_mutex); //wait for resume if (m_stop) { m_mutex->unlock(); break; } //do something m_mutex->unlock(); } delete m_condition; delete m_mutex; emit finished();}
C++ (Qt)void AutoThreadObj::process(){ forever { m_mutex->lock(); m_condition->wait(m_mutex); //wait for resume