diff options
author | ZoranAleksov <Zoran.Aleksov@seavus.com> | 2012-02-07 15:33:42 +0100 |
---|---|---|
committer | Viktor Mladenovski <viktor.mladenovski@seavus.com> | 2012-05-25 14:43:32 +0200 |
commit | 828be7d08c886347641d8bba675993caf5a13d1a (patch) | |
tree | 17e986bd43df9a9ebbe419bd4539bc6b1860d65c /source/api_wrappers/linux/CThreadWrapper.cpp | |
parent | 10184ae5b432f3dd7e014afb9a8f0ea0cd880e26 (diff) |
Delivery must be compliant with Mac OS Lion
Porting of loader communication to Mac OS Lion
ST-Ericsson ID: 358802
ST-Ericsson FOSS-OUT ID: NA
Change-Id: I2aee1b2519cb9bfd07940bdf5a9fc55d78bba7da
Depends-On: Ic1d148824eed95ed65259fc694e52f0729045208
Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/44893
Reviewed-by: QABUILD
Tested-by: Cvetko MLADENOVSKI <cvetko.mladenovski@seavus.com>
Reviewed-by: Viktor MLADENOVSKI <viktor.mladenovski@stericsson.com>
Diffstat (limited to 'source/api_wrappers/linux/CThreadWrapper.cpp')
-rw-r--r-- | source/api_wrappers/linux/CThreadWrapper.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/source/api_wrappers/linux/CThreadWrapper.cpp b/source/api_wrappers/linux/CThreadWrapper.cpp index 4fe9362..5d38fcf 100644 --- a/source/api_wrappers/linux/CThreadWrapper.cpp +++ b/source/api_wrappers/linux/CThreadWrapper.cpp @@ -35,6 +35,7 @@ CThreadWrapper::CThreadWrapper(void *(*pStartAddress)(void *), void *pArgument) m_pStartAddress = pStartAddress; m_pArgument = pArgument; m_tid = (pthread_t)0; + m_ThreadEndedEvt = new CEventObject(); } // ****************************************************************************** @@ -44,6 +45,7 @@ CThreadWrapper::CThreadWrapper(void *(*pStartAddress)(void *), void *pArgument) // ****************************************************************************** CThreadWrapper::~CThreadWrapper() { + delete m_ThreadEndedEvt; } // ****************************************************************************** @@ -53,8 +55,8 @@ CThreadWrapper::~CThreadWrapper() // ****************************************************************************** DWORD CThreadWrapper::Wait(DWORD dwMilliseconds) { - if ((int)m_tid != 0) { - return m_ThreadEndedEvt.Wait(dwMilliseconds); + if (m_tid != 0) { + return m_ThreadEndedEvt->Wait(dwMilliseconds); } else { return WAIT_OBJECT_0; } @@ -102,7 +104,7 @@ void *CThreadWrapper::ThreadFunc(void *arg) pthis->m_pStartAddress(pthis->m_pArgument); // Thread has finished, set appropriate event here - pthis->m_ThreadEndedEvt.SetEvent(); + pthis->m_ThreadEndedEvt->SetEvent(); pthread_detach(pthread_self()); pthis->m_tid = (pthread_t)0; return NULL; @@ -115,5 +117,5 @@ void *CThreadWrapper::ThreadFunc(void *arg) // ****************************************************************************** DWORD CThreadWrapper::GetThreadId() { - return (DWORD)m_tid; + return (long long)m_tid; } |