Merge branch 'master' into release
[deb_libcec.git] / src / lib / platform / threads / threads.h
index 74d683f273fa5056916d47300302f7f8f1f6da2c..8fb71fce2b2158382168379054d30750b1e0c4dc 100644 (file)
@@ -2,7 +2,7 @@
 /*
  * This file is part of the libCEC(R) library.
  *
- * libCEC(R) is Copyright (C) 2011 Pulse-Eight Limited.  All rights reserved.
+ * libCEC(R) is Copyright (C) 2011-2012 Pulse-Eight Limited.  All rights reserved.
  * libCEC(R) is an original work, containing original code.
  *
  * libCEC(R) is a trademark of Pulse-Eight Limited.
@@ -69,24 +69,25 @@ namespace PLATFORM
       return retVal;
     }
 
-    inline bool IsRunning(void)
+    virtual bool IsRunning(void)
     {
       CLockObject lock(m_threadMutex);
       return m_bRunning;
     }
 
-    inline bool IsStopped(void)
+    virtual bool IsStopped(void)
     {
       CLockObject lock(m_threadMutex);
       return m_bStop;
     }
 
-    inline bool CreateThread(bool bWait = true)
+    virtual bool CreateThread(bool bWait = true)
     {
         bool bReturn(false);
         CLockObject lock(m_threadMutex);
         if (!IsRunning())
         {
+          m_bStop = false;
           if (ThreadsCreate(m_thread, CThread::ThreadHandler, ((void*)static_cast<CThread *>(this))))
           {
             if (bWait)
@@ -97,7 +98,7 @@ namespace PLATFORM
       return bReturn;
     }
 
-    inline bool StopThread(bool bWaitForExit = true)
+    virtual bool StopThread(bool bWaitForExit = true)
     {
       bool bReturn(true);
       bool bRunning(false);
@@ -116,7 +117,7 @@ namespace PLATFORM
       return true;
     }
 
-    inline bool Sleep(uint32_t iTimeout)
+    virtual bool Sleep(uint32_t iTimeout)
     {
       CLockObject lock(m_threadMutex);
       return m_bStop ? false : m_threadCondition.Wait(m_threadMutex, iTimeout);