diff options
author | Mikhail Voitenko <mav@openoffice.org> | 2003-03-19 09:56:49 +0000 |
---|---|---|
committer | Mikhail Voitenko <mav@openoffice.org> | 2003-03-19 09:56:49 +0000 |
commit | 615ea2559fc3f29d3ded828c1b280e41c80d3203 (patch) | |
tree | 624dab2a2ce97f40d2b6cc5c97dbe9e49c019115 /embedserv/source/embed | |
parent | b9dc9f9a522ffa816fc3dcef9a0b4f24fa2c8c76 (diff) |
#i2822# let the project be independent component
Diffstat (limited to 'embedserv/source/embed')
-rwxr-xr-x | embedserv/source/embed/servprov.cxx | 47 |
1 files changed, 42 insertions, 5 deletions
diff --git a/embedserv/source/embed/servprov.cxx b/embedserv/source/embed/servprov.cxx index 9efcb668761a..a96134bc00d2 100755 --- a/embedserv/source/embed/servprov.cxx +++ b/embedserv/source/embed/servprov.cxx @@ -2,9 +2,9 @@ * * $RCSfile: servprov.cxx,v $ * - * $Revision: 1.1 $ + * $Revision: 1.2 $ * - * last change: $Author: mav $ $Date: 2003-03-05 15:50:11 $ + * last change: $Author: mav $ $Date: 2003-03-19 10:56:49 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -73,8 +73,9 @@ #ifndef _OSL_MUTEX_HXX_ #include <osl/mutex.hxx> #endif - -#include <vos/thread.hxx> +#ifndef _OSL_THREAD_H_ +#include <osl/thread.h> +#endif using namespace com::sun::star; @@ -88,6 +89,42 @@ const GUID* guidList[ SUPPORTED_FACTORIES_NUM ] = { &OID_MathServer }; +class CurThreadData +{ + public: + CurThreadData(); + virtual ~CurThreadData(); + + sal_Bool SAL_CALL setData(void *pData); + + void* SAL_CALL getData(); + + protected: + oslThreadKey m_hKey; +}; + +CurThreadData::CurThreadData() +{ + m_hKey = osl_createThreadKey( (oslThreadKeyCallbackFunction)NULL ); +} + +CurThreadData::~CurThreadData() +{ + osl_destroyThreadKey(m_hKey); +} + +sal_Bool CurThreadData::setData(void *pData) +{ + OSL_ENSURE( m_hKey, "No thread key!\n" ); + return (osl_setThreadKeyData(m_hKey, pData)); +} + +void *CurThreadData::getData() +{ + OSL_ENSURE( m_hKey, "No thread key!\n" ); + return (osl_getThreadKeyData(m_hKey)); +} + // CoInitializeEx * typedef DECLSPEC_IMPORT HRESULT (STDAPICALLTYPE *ptrCoInitEx)( LPVOID, DWORD); @@ -96,7 +133,7 @@ typedef DECLSPEC_IMPORT HRESULT (STDAPICALLTYPE *ptrCoInit)( LPVOID); void o2u_attachCurrentThread() { - static ::vos::OThreadData oleThreadData; + static CurThreadData oleThreadData; if ((sal_Bool)oleThreadData.getData() != sal_True) { |