avoid use of global mutex

This commit is contained in:
Daniel Boelzle
2000-10-06 14:15:09 +00:00
parent 52308925ab
commit b11926a7a0
2 changed files with 22 additions and 5 deletions

View File

@@ -2,9 +2,9 @@
*
* $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
* either of the following licenses
@@ -79,6 +79,21 @@ using namespace com::sun::star::lang;
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
//__________________________________________________________________________________________________