Fixed a bug in the thread implementation. A lock cannot be used within two different threads.
This commit is contained in:
+3
-1
@@ -22,6 +22,7 @@
|
||||
#define _THREAD_H_
|
||||
|
||||
#include <boost/thread.hpp>
|
||||
#include <boost/thread/barrier.hpp>
|
||||
#include <boost/shared_ptr.hpp>
|
||||
|
||||
#ifndef NANOSECONDS_PER_SECOND
|
||||
@@ -68,7 +69,6 @@ private:
|
||||
// Flag specifying whether the application code within the
|
||||
// thread was terminated.
|
||||
mutable boost::timed_mutex m_isTerminatedMutex;
|
||||
mutable boost::timed_mutex::scoped_try_lock m_isTerminatedMutexLock;
|
||||
|
||||
// Flag specifying whether the thread should be terminated.
|
||||
mutable boost::timed_mutex m_shouldTerminateMutex;
|
||||
@@ -78,6 +78,8 @@ private:
|
||||
boost::shared_ptr<boost::thread> m_threadObj;
|
||||
mutable boost::mutex m_threadObjMutex;
|
||||
|
||||
boost::barrier m_threadStartBarrier;
|
||||
|
||||
friend class ThreadStarter;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user