summaryrefslogtreecommitdiff
path: root/comphelper/source/property/propstate.cxx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2011-04-02 16:47:11 +0100
committerCaolán McNamara <caolanm@redhat.com>2011-04-03 21:43:00 +0100
commit723e74b5dc8465e6910729c84a7ecc81262c7e37 (patch)
treecc85d887712369970177904ef5d0f62d444d3287 /comphelper/source/property/propstate.cxx
parent3dfc2de702491e86dfeaaebd789f2143da6e3658 (diff)
use rtl::Static where double-locked pattern used
Diffstat (limited to 'comphelper/source/property/propstate.cxx')
-rw-r--r--comphelper/source/property/propstate.cxx16
1 files changed, 5 insertions, 11 deletions
diff --git a/comphelper/source/property/propstate.cxx b/comphelper/source/property/propstate.cxx
index 5be6c842a5f8..b58bdb6d0283 100644
--- a/comphelper/source/property/propstate.cxx
+++ b/comphelper/source/property/propstate.cxx
@@ -32,6 +32,7 @@
#include <com/sun/star/uno/genfunc.h>
#include <cppuhelper/queryinterface.hxx>
#include <comphelper/sequence.hxx>
+#include <rtl/instance.hxx>
//.........................................................................
namespace comphelper
@@ -217,20 +218,13 @@ namespace comphelper
);
}
+ namespace { struct lcl_ImplId : public rtl::Static< ::cppu::OImplementationId, lcl_ImplId > {}; }
+
//---------------------------------------------------------------------
Sequence< sal_Int8 > SAL_CALL OStatefulPropertySet::getImplementationId() throw(RuntimeException)
{
- static ::cppu::OImplementationId * pId = NULL;
- if ( !pId )
- {
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if ( !pId )
- {
- static ::cppu::OImplementationId aId;
- pId = &aId;
- }
- }
- return pId->getImplementationId();
+ ::cppu::OImplementationId &rID = lcl_ImplId::get();
+ return rID.getImplementationId();
}
//---------------------------------------------------------------------