Kaydet (Commit) a5aaf693 authored tarafından Ivo Hinkelmann's avatar Ivo Hinkelmann

INTEGRATION: CWS configrefactor01 (1.6.24); FILE MERGED

2007/01/11 20:16:02 mmeeks 1.6.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
üst 1ffc03c8
...@@ -4,9 +4,9 @@ ...@@ -4,9 +4,9 @@
* *
* $RCSfile: bootstrapcontext.cxx,v $ * $RCSfile: bootstrapcontext.cxx,v $
* *
* $Revision: 1.6 $ * $Revision: 1.7 $
* *
* last change: $Author: obo $ $Date: 2006-09-16 15:14:28 $ * last change: $Author: ihi $ $Date: 2007-11-23 14:28:57 $
* *
* The Contents of this file are made available subject to * The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1. * the terms of GNU Lesser General Public License Version 2.1.
...@@ -59,6 +59,9 @@ ...@@ -59,6 +59,9 @@
#ifndef _COM_SUN_STAR_LANG_DISPOSEDEXCEPTION_HPP_ #ifndef _COM_SUN_STAR_LANG_DISPOSEDEXCEPTION_HPP_
#include <com/sun/star/lang/DisposedException.hpp> #include <com/sun/star/lang/DisposedException.hpp>
#endif #endif
#ifndef CONFIGMGR_UTILITY_HXX_
#include "utility.hxx"
#endif
namespace configmgr namespace configmgr
{ {
...@@ -81,8 +84,7 @@ static void testComplete() ...@@ -81,8 +84,7 @@ static void testComplete()
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
ComponentContext::ComponentContext(Context const & _xContext) ComponentContext::ComponentContext(Context const & _xContext)
: ComponentContext_Base(m_aMutex) : ComponentContext_Base(UnoApiLock::getLock())
, m_aMutex()
, m_xContext(_xContext) , m_xContext(_xContext)
, m_hBootstrapData(NULL) , m_hBootstrapData(NULL)
, m_xServiceManager() , m_xServiceManager()
...@@ -98,15 +100,13 @@ ComponentContext::~ComponentContext() ...@@ -98,15 +100,13 @@ ComponentContext::~ComponentContext()
void ComponentContext::initialize( const OUString& _aURL ) void ComponentContext::initialize( const OUString& _aURL )
{ {
osl::ClearableMutexGuard lock(mutex()); UnoApiLock aLock;
OSL_ASSERT(!m_hBootstrapData); OSL_ASSERT(!m_hBootstrapData);
m_hBootstrapData = rtl_bootstrap_args_open(_aURL.pData); m_hBootstrapData = rtl_bootstrap_args_open(_aURL.pData);
uno::Reference< lang::XComponent > xOwner(m_xContext, uno::UNO_QUERY); uno::Reference< lang::XComponent > xOwner(m_xContext, uno::UNO_QUERY);
lock.clear();
if (xOwner.is()) DisposingForwarder::forward(xOwner,this); if (xOwner.is()) DisposingForwarder::forward(xOwner,this);
if (!m_xContext.is()) if (!m_xContext.is())
...@@ -120,7 +120,7 @@ void ComponentContext::initialize( const OUString& _aURL ) ...@@ -120,7 +120,7 @@ void ComponentContext::initialize( const OUString& _aURL )
// ComponentHelper // ComponentHelper
void SAL_CALL ComponentContext::disposing() void SAL_CALL ComponentContext::disposing()
{ {
osl::MutexGuard lock(mutex()); UnoApiLock aLock;
m_xContext.clear(); m_xContext.clear();
...@@ -136,7 +136,8 @@ OUString ComponentContext::getBootstrapURL() const ...@@ -136,7 +136,8 @@ OUString ComponentContext::getBootstrapURL() const
{ {
OUString aResult; OUString aResult;
osl::MutexGuard lock(mutex()); UnoApiLock aLock;
if (m_hBootstrapData) if (m_hBootstrapData)
{ {
rtl_bootstrap_get_iniName_from_handle(m_hBootstrapData,&aResult.pData); rtl_bootstrap_get_iniName_from_handle(m_hBootstrapData,&aResult.pData);
...@@ -152,7 +153,7 @@ OUString ComponentContext::getBootstrapURL() const ...@@ -152,7 +153,7 @@ OUString ComponentContext::getBootstrapURL() const
void ComponentContext::changeBootstrapURL( const OUString& _aURL ) void ComponentContext::changeBootstrapURL( const OUString& _aURL )
{ {
osl::MutexGuard lock(mutex()); UnoApiLock aLock;
if (rtlBootstrapHandle hNew = rtl_bootstrap_args_open(_aURL.pData)) if (rtlBootstrapHandle hNew = rtl_bootstrap_args_open(_aURL.pData))
{ {
...@@ -170,7 +171,7 @@ uno::Reference< lang::XMultiComponentFactory > SAL_CALL ...@@ -170,7 +171,7 @@ uno::Reference< lang::XMultiComponentFactory > SAL_CALL
ComponentContext::getServiceManager( ) ComponentContext::getServiceManager( )
throw (uno::RuntimeException) throw (uno::RuntimeException)
{ {
osl::MutexGuard lock(mutex()); UnoApiLock aLock;
if (!m_xServiceManager.is()) if (!m_xServiceManager.is())
{ {
...@@ -262,7 +263,7 @@ bool ComponentContext::lookupInContext( uno::Any & _rValue, const OUString& _aNa ...@@ -262,7 +263,7 @@ bool ComponentContext::lookupInContext( uno::Any & _rValue, const OUString& _aNa
bool ComponentContext::lookupInBootstrap( uno::Any & _rValue, const OUString& _aName ) const bool ComponentContext::lookupInBootstrap( uno::Any & _rValue, const OUString& _aName ) const
{ {
osl::MutexGuard lock(mutex()); UnoApiLock aLock;
OUString sResult; OUString sResult;
if ( rtl_bootstrap_get_from_handle( m_hBootstrapData, _aName.pData, &sResult.pData, 0) ) if ( rtl_bootstrap_get_from_handle( m_hBootstrapData, _aName.pData, &sResult.pData, 0) )
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment