summaryrefslogtreecommitdiff
path: root/unotools/source/config/extendedsecurityoptions.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'unotools/source/config/extendedsecurityoptions.cxx')
-rw-r--r--unotools/source/config/extendedsecurityoptions.cxx24
1 files changed, 6 insertions, 18 deletions
diff --git a/unotools/source/config/extendedsecurityoptions.cxx b/unotools/source/config/extendedsecurityoptions.cxx
index d64958b15b4e..fe5cc90d28cb 100644
--- a/unotools/source/config/extendedsecurityoptions.cxx
+++ b/unotools/source/config/extendedsecurityoptions.cxx
@@ -509,29 +509,17 @@ void SvtExtendedSecurityOptions::SetOpenHyperlinkMode( SvtExtendedSecurityOption
m_pDataContainer->SetOpenHyperlinkMode( eMode );
}
+namespace
+{
+ class theExtendedSecurityOptionsMutex : public rtl::Static<osl::Mutex, theExtendedSecurityOptionsMutex>{};
+}
+
//*****************************************************************************************************************
// private method
//*****************************************************************************************************************
Mutex& SvtExtendedSecurityOptions::GetInitMutex()
{
- // Initialize static mutex only for one time!
- static Mutex* pMutex = NULL;
- // If these method first called (Mutex not already exist!) ...
- if( pMutex == NULL )
- {
- // ... we must create a new one. Protect follow code with the global mutex -
- // It must be - we create a static variable!
- MutexGuard aGuard( Mutex::getGlobalMutex() );
- // We must check our pointer again - because it can be that another instance of ouer class will be fastr then these!
- if( pMutex == NULL )
- {
- // Create the new mutex and set it for return on static variable.
- static Mutex aMutex;
- pMutex = &aMutex;
- }
- }
- // Return new created or already existing mutex object.
- return *pMutex;
+ return theExtendedSecurityOptionsMutex::get();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */