diff options
author | Caolán McNamara <caolanm@redhat.com> | 2011-04-04 13:09:33 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2011-04-04 13:09:33 +0100 |
commit | 71b6f3d9a3bb80d0658cdcd578646daacc68cf95 (patch) | |
tree | 2b76cb7baae9d08a89e9e8e0ba1e940238be391f /cppuhelper/source/factory.cxx | |
parent | 44d2445580c8f8c8555a1c94c445805f0305f3bd (diff) |
use rtl::Static where double-locked pattern used
Diffstat (limited to 'cppuhelper/source/factory.cxx')
-rw-r--r-- | cppuhelper/source/factory.cxx | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/cppuhelper/source/factory.cxx b/cppuhelper/source/factory.cxx index 3135c3447619..2958e1505f5f 100644 --- a/cppuhelper/source/factory.cxx +++ b/cppuhelper/source/factory.cxx @@ -35,6 +35,7 @@ #include <cppuhelper/factory.hxx> #include <cppuhelper/implbase3.hxx> #include <cppuhelper/typeprovider.hxx> +#include <rtl/instance.hxx> #include <rtl/unload.h> #include "cppuhelper/propshlp.hxx" @@ -421,20 +422,16 @@ Sequence< Type > OFactoryComponentHelper::getTypes() return Sequence< Type >( ar, m_fptr ? 4 : 3 ); } +namespace +{ + class theOFactoryComponentHelperImplementationId : + public rtl::Static<OImplementationId, theOFactoryComponentHelperImplementationId>{}; +} + Sequence< sal_Int8 > OFactoryComponentHelper::getImplementationId() throw (::com::sun::star::uno::RuntimeException) { - static OImplementationId * pId = 0; - if (! pId) - { - MutexGuard aGuard( Mutex::getGlobalMutex() ); - if (! pId) - { - static OImplementationId aId; - pId = &aId; - } - } - return pId->getImplementationId(); + return theOFactoryComponentHelperImplementationId::get().getImplementationId(); } // XSingleServiceFactory |