From 76c92d6c36b3c09c4eaa38fd742296c0c2f66243 Mon Sep 17 00:00:00 2001 From: Kai Sommerfeld Date: Thu, 21 Dec 2000 08:23:35 +0000 Subject: #82494# - Workaround to reduce CPU load in case config data are broken. --- ucb/source/core/ucbstore.cxx | 30 +++++++++++++++++++++++++++--- 1 file changed, 27 insertions(+), 3 deletions(-) (limited to 'ucb/source/core/ucbstore.cxx') diff --git a/ucb/source/core/ucbstore.cxx b/ucb/source/core/ucbstore.cxx index d74b236a74e1..08bde168cdd2 100644 --- a/ucb/source/core/ucbstore.cxx +++ b/ucb/source/core/ucbstore.cxx @@ -2,9 +2,9 @@ * * $RCSfile: ucbstore.cxx,v $ * - * $Revision: 1.6 $ + * $Revision: 1.7 $ * - * last change: $Author: kso $ $Date: 2000-12-10 15:13:04 $ + * last change: $Author: kso $ $Date: 2000-12-21 09:23:35 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -333,9 +333,13 @@ struct PropertySetRegistry_Impl Reference< XInterface > m_xRootReadAccess; Reference< XInterface > m_xRootWriteAccess; osl::Mutex m_aMutex; + sal_Bool m_bTriedToGetRootReadAccess; // #82494# + sal_Bool m_bTriedToGetRootWriteAccess; // #82494# PropertySetRegistry_Impl( UcbStore& rCreator ) - : m_pCreator( &rCreator ) + : m_pCreator( &rCreator ), + m_bTriedToGetRootReadAccess( sal_False ), + m_bTriedToGetRootWriteAccess( sal_False ) { m_pCreator->acquire(); } @@ -1296,6 +1300,14 @@ Reference< XInterface > PropertySetRegistry::getRootConfigReadAccess() if ( !m_pImpl->m_xRootReadAccess.is() ) { + if ( m_pImpl->m_bTriedToGetRootReadAccess ) // #82494# + { + OSL_ENSURE( sal_False, + "PropertySetRegistry::getRootConfigReadAccess - " + "Unable to read any config data! -> #82494#" ); + return Reference< XInterface >(); + } + getConfigProvider(); if ( m_pImpl->m_xConfigProvider.is() ) @@ -1304,6 +1316,8 @@ Reference< XInterface > PropertySetRegistry::getRootConfigReadAccess() aArguments[ 0 ] <<= OUString::createFromAscii( STORE_CONTENTPROPERTIES_KEY ); + m_pImpl->m_bTriedToGetRootReadAccess = sal_True; + m_pImpl->m_xRootReadAccess = m_pImpl->m_xConfigProvider->createInstanceWithArguments( OUString::createFromAscii( @@ -1345,6 +1359,14 @@ Reference< XInterface > PropertySetRegistry::getConfigWriteAccess( if ( !m_pImpl->m_xRootWriteAccess.is() ) { + if ( m_pImpl->m_bTriedToGetRootWriteAccess ) // #82494# + { + OSL_ENSURE( sal_False, + "PropertySetRegistry::getConfigWriteAccess - " + "Unable to write any config data! -> #82494#" ); + return Reference< XInterface >(); + } + getConfigProvider(); if ( m_pImpl->m_xConfigProvider.is() ) @@ -1353,6 +1375,8 @@ Reference< XInterface > PropertySetRegistry::getConfigWriteAccess( aArguments[ 0 ] <<= OUString::createFromAscii( STORE_CONTENTPROPERTIES_KEY ); + m_pImpl->m_bTriedToGetRootWriteAccess = sal_True; + m_pImpl->m_xRootWriteAccess = m_pImpl->m_xConfigProvider->createInstanceWithArguments( OUString::createFromAscii( -- cgit v1.2.3