diff options
author | Caolán McNamara <caolanm@redhat.com> | 2011-04-03 21:34:16 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2011-04-03 21:43:01 +0100 |
commit | f183d3a500626354508993d453e265da9614df45 (patch) | |
tree | 9ce9e5dc75b002d1901f905083c66eeaaa3799ff /unotools/source/config/optionsdlg.cxx | |
parent | 41d271db85a1adec8591f08b969695c0f7885356 (diff) |
use rtl::Static where double-locked pattern used
Diffstat (limited to 'unotools/source/config/optionsdlg.cxx')
-rw-r--r-- | unotools/source/config/optionsdlg.cxx | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/unotools/source/config/optionsdlg.cxx b/unotools/source/config/optionsdlg.cxx index c8a12c088804..4aeb603a6717 100644 --- a/unotools/source/config/optionsdlg.cxx +++ b/unotools/source/config/optionsdlg.cxx @@ -92,20 +92,14 @@ public: const OUString& _rGroup ) const; }; -::osl::Mutex & SvtOptionsDlgOptions_Impl::getInitMutex() +namespace { - static ::osl::Mutex *pMutex = 0; + class theOptionsDlgOptions_ImplMutex : public rtl::Static<osl::Mutex, theOptionsDlgOptions_ImplMutex>{}; +} - if( ! pMutex ) - { - ::osl::MutexGuard guard( ::osl::Mutex::getGlobalMutex() ); - if( ! pMutex ) - { - static ::osl::Mutex mutex; - pMutex = &mutex; - } - } - return *pMutex; +::osl::Mutex & SvtOptionsDlgOptions_Impl::getInitMutex() +{ + return theOptionsDlgOptions_ImplMutex::get(); } // ----------------------------------------------------------------------- |