diff options
author | Ivo Hinkelmann <ihi@openoffice.org> | 2007-11-23 13:29:56 +0000 |
---|---|---|
committer | Ivo Hinkelmann <ihi@openoffice.org> | 2007-11-23 13:29:56 +0000 |
commit | b43c29fa9f89cef0985857994fb29e5d70009912 (patch) | |
tree | 73deb61ef1d94d95282112ae151daa5768d36e5e /configmgr/source/registry | |
parent | acd4dd19335e493a76db79b30acd5737d2cf15a9 (diff) |
INTEGRATION: CWS configrefactor01 (1.11.24); FILE MERGED
2007/01/11 20:16:02 mmeeks 1.11.24.1: Submitted by: mmeeks
More re-factoring, lots of locking rationalized, drastically reduced
the mutex count, also removed ~300k interlocked increments with a non-interlocking
SimpleReferencedObject base
Diffstat (limited to 'configmgr/source/registry')
-rw-r--r-- | configmgr/source/registry/configregistry.cxx | 29 |
1 files changed, 15 insertions, 14 deletions
diff --git a/configmgr/source/registry/configregistry.cxx b/configmgr/source/registry/configregistry.cxx index 52dd4fd6cc..6f34bf1e41 100644 --- a/configmgr/source/registry/configregistry.cxx +++ b/configmgr/source/registry/configregistry.cxx @@ -4,9 +4,9 @@ * * $RCSfile: configregistry.cxx,v $ * - * $Revision: 1.11 $ + * $Revision: 1.12 $ * - * last change: $Author: obo $ $Date: 2006-09-16 15:19:38 $ + * last change: $Author: ihi $ $Date: 2007-11-23 14:29:56 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -46,6 +46,9 @@ #ifndef CONFIGMGR_API_FACTORY_HXX_ #include "confapifactory.hxx" #endif +#ifndef CONFIGMGR_UTILITY_HXX_ +#include "utility.hxx" +#endif #ifndef _COMPHELPER_SEQUENCE_HXX_ #include <comphelper/sequence.hxx> @@ -197,7 +200,7 @@ Sequence< sal_Int8 > SAL_CALL OConfigurationRegistry::getImplementationId( ) th //-------------------------------------------------------------------------- ::rtl::OUString SAL_CALL OConfigurationRegistry::getURL() throw(RuntimeException) { - MutexGuard aGuard(m_aMutex); + UnoApiLock aLock; return m_sLocation; } @@ -213,7 +216,7 @@ void OConfigurationRegistry::implCheckOpen() throw(InvalidRegistryException, Run //-------------------------------------------------------------------------- void SAL_CALL OConfigurationRegistry::open( const ::rtl::OUString& _rURL, sal_Bool _bReadOnly, sal_Bool /*_bCreate*/ ) throw(InvalidRegistryException, RuntimeException) { - MutexGuard aGuard(m_aMutex); + UnoApiLock aLock; if (implIsOpen()) close(); @@ -272,7 +275,7 @@ void SAL_CALL OConfigurationRegistry::open( const ::rtl::OUString& _rURL, sal_Bo //-------------------------------------------------------------------------- sal_Bool SAL_CALL OConfigurationRegistry::isValid( ) throw(RuntimeException) { - MutexGuard aGuard(m_aMutex); + UnoApiLock aLock; return implIsOpen(); } @@ -285,7 +288,7 @@ sal_Bool OConfigurationRegistry::implIsOpen( ) throw(RuntimeException) //-------------------------------------------------------------------------- void SAL_CALL OConfigurationRegistry::close( ) throw(InvalidRegistryException, RuntimeException) { - ClearableMutexGuard aGuard(m_aMutex); + UnoApiLock aLock; Reference< XRegistryKey > xRootKey(m_xRootKey); m_xRootKey = NULL; @@ -296,8 +299,6 @@ void SAL_CALL OConfigurationRegistry::close( ) throw(InvalidRegistryException, m_sLocation = ::rtl::OUString(); - aGuard.clear(); - if (xRootKey.is()) xRootKey->closeKey(); @@ -311,7 +312,7 @@ void SAL_CALL OConfigurationRegistry::disposing() close(); { - MutexGuard aGuard(m_aMutex); + UnoApiLock aLock; m_xConfigurationProvider.clear(); m_xORB.clear(); @@ -323,7 +324,7 @@ void SAL_CALL OConfigurationRegistry::disposing() //-------------------------------------------------------------------------- void SAL_CALL OConfigurationRegistry::destroy( ) throw(InvalidRegistryException, RuntimeException) { - MutexGuard aGuard(m_aMutex); + UnoApiLock aLock; implCheckOpen(); throw InvalidRegistryException(UNISTRING("This registry is a wrapper for a configuration access. It can not be destroyed."), THISREF()); @@ -332,7 +333,7 @@ void SAL_CALL OConfigurationRegistry::destroy( ) throw(InvalidRegistryException //-------------------------------------------------------------------------- Reference< XRegistryKey > SAL_CALL OConfigurationRegistry::getRootKey( ) throw(InvalidRegistryException, RuntimeException) { - MutexGuard aGuard(m_aMutex); + UnoApiLock aLock; implCheckOpen(); return m_xRootKey; @@ -341,7 +342,7 @@ Reference< XRegistryKey > SAL_CALL OConfigurationRegistry::getRootKey( ) throw( //-------------------------------------------------------------------------- sal_Bool SAL_CALL OConfigurationRegistry::isReadOnly( ) throw(InvalidRegistryException, RuntimeException) { - MutexGuard aGuard(m_aMutex); + UnoApiLock aLock; implCheckOpen(); return !m_xUpdateRoot.is(); @@ -351,7 +352,7 @@ sal_Bool SAL_CALL OConfigurationRegistry::isReadOnly( ) throw(InvalidRegistryEx //-------------------------------------------------------------------------- void SAL_CALL OConfigurationRegistry::mergeKey( const ::rtl::OUString& /*aKeyName*/, const ::rtl::OUString& /*aUrl*/ ) throw(InvalidRegistryException, MergeConflictException, RuntimeException) { - MutexGuard aGuard(m_aMutex); + UnoApiLock aLock; implCheckOpen(); // not supported. but we can't throw an NoSupportException here ... @@ -362,7 +363,7 @@ void SAL_CALL OConfigurationRegistry::mergeKey( const ::rtl::OUString& /*aKeyNam void SAL_CALL OConfigurationRegistry::flush( ) throw(RuntimeException) { { - MutexGuard aGuard(m_aMutex); + UnoApiLock aLock; if (m_xUpdateRoot.is()) { try |