QT 线程的暂停和继续

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

.h文件

#include <QMutex>

QMutex  _mutex;

.cpp文件

//暂停

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

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

posted on 2019-03-06 09:48  小小小哈  阅读(2919)  评论(0编辑  收藏  举报

导航