1.互斥量(QMutex)
头文件声明: #include <QMutex>
互斥量声明: QMutex m_Mutex;
互斥量加锁: m_Mutex.lock();
互斥量解锁: m_Mutex.unlock();
2.互斥锁(QMutexLocker)
头文件声明: #include<QMutexLocker>
互斥锁声明: QMutexLocker mutexLocker(&m_Mutex);
互斥锁加锁: 从声明处开始(在构造函数中加锁)
互斥锁解锁: 出了作用域自动解锁(在析构函数中解锁)
3.等待条件(QWaitCondition)
头文件声明: #include <QWaitCondition>
等待条件声明: QWaitCondtion m_WaitCondition;
等待条件等待: m_WaitConditon.wait(&m_muxtex, time);
等待条件唤醒: m_WaitCondition.wakeAll();
原文地址:http://blog.csdn.net/u011014707/article/details/38058467