1
0

Fixed minor errors in Tycho's code

Everything should work now :)
This commit is contained in:
Tiger Wang
2015-06-22 21:27:13 +01:00
parent dd4b415051
commit 33fc1474d9
7 changed files with 84 additions and 93 deletions

View File

@@ -32,10 +32,6 @@ protected:
/** The overriden Execute() method should check this value periodically and terminate if this is true. */
volatile bool m_ShouldTerminate;
private:
/** Wrapper for Execute() that waits for the initialization event, to prevent race conditions in thread initialization. */
void DoExecute(void);
public:
cIsThread(const AString & a_ThreadName);
virtual ~cIsThread();
@@ -51,14 +47,21 @@ public:
/** Returns true if the thread calling this function is the thread contained within this object. */
bool IsCurrentThread(void) const { return std::this_thread::get_id() == m_Thread.get_id(); }
private:
protected:
/** The name of the thread, used to aid debugging in IDEs which support named threads */
AString m_ThreadName;
/** The thread object which holds the created thread for later manipulation */
std::thread m_Thread;
/** The event that is used to wait with the thread's execution until the thread object is fully initialized.
This prevents the IsCurrentThread() call to fail because of a race-condition. */
This prevents the IsCurrentThread() call to fail because of a race-condition where the thread starts before m_Thread has been fully assigned. */
cEvent m_evtStart;
/** Wrapper for Execute() that waits for the initialization event, to prevent race conditions in thread initialization. */
void DoExecute(void);
} ;