Fixed a bug in the thread implementation. A lock cannot be used within two different threads.

This commit is contained in:
lotodore
2007-02-18 17:48:36 +00:00
parent 389252aac2
commit fe52316be5
2 changed files with 9 additions and 5 deletions
+3 -1
View File
@@ -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;
};