X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Flib%2Fplatform%2Fthreads%2Fthreads.h;h=8fb71fce2b2158382168379054d30750b1e0c4dc;hb=c12ee8e65c67f6435fba0a09cbea363b13f6c56d;hp=74d683f273fa5056916d47300302f7f8f1f6da2c;hpb=f00ff009cfc5dfefdf09ca241b9560e74575b3f5;p=deb_libcec.git diff --git a/src/lib/platform/threads/threads.h b/src/lib/platform/threads/threads.h index 74d683f..8fb71fc 100644 --- a/src/lib/platform/threads/threads.h +++ b/src/lib/platform/threads/threads.h @@ -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(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);