INTEGRATION: CWS warnings01 (1.5.134); FILE MERGED

2005/11/21 15:07:04 sb 1.5.134.5: #i53898# Made code warning-free.
2005/09/23 00:19:34 sb 1.5.134.4: RESYNC: (1.5-1.6); FILE MERGED
2005/09/09 07:56:49 sb 1.5.134.3: #i53898# Improved previous change.
2005/09/08 14:08:42 sb 1.5.134.2: #i53898# Simplified previous change.
2005/09/07 16:34:16 sb 1.5.134.1: #i53898# Made code warning-free.
This commit is contained in:
Jens-Heiner Rechtien
2006-06-20 10:23:08 +00:00
parent de5a4e60ef
commit ba5f15e44a

View File

@@ -4,9 +4,9 @@
* *
* $RCSfile: thread.cxx,v $ * $RCSfile: thread.cxx,v $
* *
* $Revision: 1.7 $ * $Revision: 1.8 $
* *
* last change: $Author: vg $ $Date: 2006-06-02 12:45:11 $ * last change: $Author: hr $ $Date: 2006-06-20 11:23:08 $
* *
* The Contents of this file are made available subject to * The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1. * the terms of GNU Lesser General Public License Version 2.1.
@@ -40,22 +40,9 @@
#include <vos/object.hxx> #include <vos/object.hxx>
#include <vos/thread.hxx> #include <vos/thread.hxx>
using namespace vos;
void vos::threadWorkerFunction_impl(void * pthis)
#if !defined ( WNT )
void _OThread_WorkerFunction(void* pthis)
{
NAMESPACE_VOS(_cpp_OThread_WorkerFunction)(pthis);
}
void NAMESPACE_VOS(_cpp_OThread_WorkerFunction)(void* pthis)
#else
void SAL_CALL _OThread_WorkerFunction(void* pthis)
#endif
{ {
NAMESPACE_VOS(OThread)* pThis= (NAMESPACE_VOS(OThread)*)pthis; NAMESPACE_VOS(OThread)* pThis= (NAMESPACE_VOS(OThread)*)pthis;
@@ -71,8 +58,6 @@ void SAL_CALL _OThread_WorkerFunction(void* pthis)
} }
} }
using namespace vos;
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// //
// Thread class // Thread class
@@ -103,8 +88,9 @@ sal_Bool OThread::create()
{ {
VOS_ASSERT(m_hThread == 0); // only one running thread per instance VOS_ASSERT(m_hThread == 0); // only one running thread per instance
if (m_hThread= osl_createSuspendedThread(_OThread_WorkerFunction, m_hThread = osl_createSuspendedThread(
(void*)this)) threadWorkerFunction_impl, (void*)this);
if (m_hThread)
osl_resumeThread(m_hThread); osl_resumeThread(m_hThread);
return m_hThread != 0; return m_hThread != 0;
@@ -114,8 +100,7 @@ sal_Bool OThread::createSuspended()
{ {
VOS_ASSERT(m_hThread == 0); // only one running thread per instance VOS_ASSERT(m_hThread == 0); // only one running thread per instance
m_hThread= osl_createSuspendedThread(_OThread_WorkerFunction, m_hThread= osl_createSuspendedThread(threadWorkerFunction_impl, (void*)this);
(void*)this);
return m_hThread != 0; return m_hThread != 0;
} }
@@ -240,7 +225,8 @@ VOS_IMPLEMENT_CLASSINFO(VOS_CLASSNAME(OThreadData, vos),
OThreadData::OThreadData( oslThreadKeyCallbackFunction pCallback ) OThreadData::OThreadData( oslThreadKeyCallbackFunction pCallback )
{ {
VOS_VERIFY(m_hKey = osl_createThreadKey( pCallback )); m_hKey = osl_createThreadKey( pCallback );
VOS_VERIFY(m_hKey);
} }
OThreadData::~OThreadData() OThreadData::~OThreadData()