fixed: somenow not initializing this pointer crashes us in libpthread
[deb_libcec.git] / src / lib / platform / threads / threads.h
index 0cc07eee883f6646e98bd65b6cfb601f5d8c1c96..6cc240644dc5659fd2bfea838cabb975fac98a3a 100644 (file)
@@ -46,9 +46,11 @@ namespace PLATFORM
     virtual ~CThread(void)
     {
       StopThread(0);
-      void *retVal;
+      void *retVal = NULL;
       ThreadsWait(m_thread, &retVal);
+      #if defined(__WINDOWS__)
       (void *)retVal; //"unreferenced local variable" warning
+      #endif
     }
 
     static void *ThreadHandler(CThread *thread)
@@ -143,13 +145,13 @@ namespace PLATFORM
 
   protected:
     void SetRunning(bool bSetTo);
+    CMutex           m_threadMutex;
 
   private:
     bool             m_bStop;
     bool             m_bRunning;
     bool             m_bStopped;
     CCondition<bool> m_threadCondition;
-    CMutex           m_threadMutex;
     thread_t         m_thread;
   };
 };