Kaydet (Commit) b11926a7 authored tarafından Daniel Boelzle's avatar Daniel Boelzle

avoid use of global mutex

üst 52308925
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* *
* $RCSfile: implbase.hxx,v $ * $RCSfile: implbase.hxx,v $
* *
* $Revision: 1.1.1.1 $ * $Revision: 1.2 $
* *
* last change: $Author: hr $ $Date: 2000-09-18 15:26:09 $ * last change: $Author: dbo $ $Date: 2000-10-06 15:15:09 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
...@@ -109,6 +109,8 @@ struct ClassData : public ClassDataBase ...@@ -109,6 +109,8 @@ struct ClassData : public ClassDataBase
::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId(); ::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId();
}; };
//==================================================================================================
::osl::Mutex & SAL_CALL getImplHelperInitMutex(void);
} }
// //
...@@ -136,7 +138,7 @@ protected: \ ...@@ -136,7 +138,7 @@ protected: \
ClassData & rCD = * static_cast< ClassData * >( &s_aCD ); \ ClassData & rCD = * static_cast< ClassData * >( &s_aCD ); \
if (! rCD.bOffsetsInit) \ if (! rCD.bOffsetsInit) \
{ \ { \
::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() ); \ ::osl::MutexGuard aGuard( getImplHelperInitMutex() ); \
if (! rCD.bOffsetsInit) \ if (! rCD.bOffsetsInit) \
{ \ { \
char * pBase = (char *)this; char * pBase = (char *)this;
......
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* *
* $RCSfile: implbase.cxx,v $ * $RCSfile: implbase.cxx,v $
* *
* $Revision: 1.1.1.1 $ * $Revision: 1.2 $
* *
* last change: $Author: hr $ $Date: 2000-09-18 15:26:10 $ * last change: $Author: dbo $ $Date: 2000-10-06 15:15:09 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
...@@ -79,6 +79,21 @@ using namespace com::sun::star::lang; ...@@ -79,6 +79,21 @@ using namespace com::sun::star::lang;
namespace cppu namespace cppu
{ {
//==================================================================================================
Mutex & SAL_CALL getImplHelperInitMutex(void)
{
static Mutex * s_pMutex = 0;
if (! s_pMutex)
{
MutexGuard aGuard( Mutex::getGlobalMutex() );
if (! s_pMutex)
{
static Mutex s_aMutex;
s_pMutex = & s_aMutex;
}
}
return * s_pMutex;
}
// ClassDataBase // ClassDataBase
//__________________________________________________________________________________________________ //__________________________________________________________________________________________________
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment