QT 线程的暂停和继续

可使用互斥量的方式,来进行暂停和开继续this

.h文件thread

#include <QMutex>文件

QMutex  _mutex;void

.cpp文件

//暂停

void mythread::pause()
{
    this->_mutex.lock();
}

//开始void mythread::resume(){    this-> _mutex.unlock();}

相关文章
相关标签/搜索