X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Flib%2Fplatform%2Fthreads%2Fthreads.h;h=d99cbf6bee34345aa9a54256a881676124094c29;hb=90b7066f7129c01c5bd012a00677ebdc0c42ae89;hp=0cc07eee883f6646e98bd65b6cfb601f5d8c1c96;hpb=ce37a9b17b1eee6488f6d3cdba534d5da71c3ea4;p=deb_libcec.git diff --git a/src/lib/platform/threads/threads.h b/src/lib/platform/threads/threads.h index 0cc07ee..d99cbf6 100644 --- a/src/lib/platform/threads/threads.h +++ b/src/lib/platform/threads/threads.h @@ -41,14 +41,15 @@ namespace PLATFORM CThread(void) : m_bStop(false), m_bRunning(false), - m_bStopped(false) {} + m_bStopped(false), + m_thread(INVALID_THREAD_VALUE) {} virtual ~CThread(void) { StopThread(0); - void *retVal; - ThreadsWait(m_thread, &retVal); - (void *)retVal; //"unreferenced local variable" warning + void *retVal = NULL; + if (m_thread != INVALID_THREAD_VALUE) + if (ThreadsWait(m_thread, &retVal)){}; // silence unused warning } static void *ThreadHandler(CThread *thread) @@ -143,13 +144,13 @@ namespace PLATFORM protected: void SetRunning(bool bSetTo); + CMutex m_threadMutex; private: bool m_bStop; bool m_bRunning; bool m_bStopped; CCondition m_threadCondition; - CMutex m_threadMutex; thread_t m_thread; }; };