Use C++11 threads instead of custom pthread wrappers.

Signal handling of CThread was handled in previous commit.
This commit is contained in:
Alexey Sokolov
2015-10-31 22:08:23 +00:00
parent dfa94d6bc1
commit 9c48119897
3 changed files with 16 additions and 170 deletions

View File

@@ -40,14 +40,14 @@ public:
// and signal it to exit
m_bThreadDone = true;
m_CV.broadcast();
m_CV.notify_all();
}
virtual void runThread() {
CMutexLocker locker(m_Mutex);
// We are running
m_bThreadReady = true;
m_CV.broadcast();
m_CV.notify_all();
// wait for our exit signal
while (!m_bThreadDone)
@@ -97,7 +97,7 @@ public:
m_Mutex.lock();
// We are running, tell the main thread
m_bThreadReady = true;
m_CVThreadReady.broadcast();
m_CVThreadReady.notify_all();
// Have to unlock here so that wait() can get the mutex
m_Mutex.unlock();