diff options
author | Daniel Boelzle <dbo@openoffice.org> | 2000-10-06 14:15:09 +0000 |
---|---|---|
committer | Daniel Boelzle <dbo@openoffice.org> | 2000-10-06 14:15:09 +0000 |
commit | b11926a7a02ac26273eae8bc114a47d577e3ebcc (patch) | |
tree | 8b68b7d079f82bd99bfb46ed4e805debfa8dc839 /cppuhelper/source/implbase.cxx | |
parent | 52308925aba83cc19cfcf6c01f110e225aceae1a (diff) |
avoid use of global mutex
Diffstat (limited to 'cppuhelper/source/implbase.cxx')
-rw-r--r-- | cppuhelper/source/implbase.cxx | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/cppuhelper/source/implbase.cxx b/cppuhelper/source/implbase.cxx index a01c12fde4e0..15df99d0f72a 100644 --- a/cppuhelper/source/implbase.cxx +++ b/cppuhelper/source/implbase.cxx @@ -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 //__________________________________________________________________________________________________ |