diff options
author | Michael Stahl <mstahl@redhat.com> | 2014-10-08 15:11:34 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2014-10-08 15:46:05 +0200 |
commit | 26b79470cabb191c3291789f99d8737da1a4fbab (patch) | |
tree | fab47c7863114e4e7be02ed6205c82b057d406b2 /basic | |
parent | e52758fec2a9f406df44495ca52166fb33966b32 (diff) |
basic::ImplRepository: use SolarMutex instead of own mutex
The locking strategy in the basic module is totally unclear to me, there
does not appear to be a dedicated mutex for the core stuff callable via
StarBASIC, just a bunch of SolarMutexGuards at random locations;
let's try to use SolarMutex at the UNO entry points...
Change-Id: Ia9c45fdcfb5ffd0a4acc77ef5d2fabfb8743ad38
Diffstat (limited to 'basic')
-rw-r--r-- | basic/source/basmgr/basicmanagerrepository.cxx | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/basic/source/basmgr/basicmanagerrepository.cxx b/basic/source/basmgr/basicmanagerrepository.cxx index bcf0855f8472..d7928d883397 100644 --- a/basic/source/basmgr/basicmanagerrepository.cxx +++ b/basic/source/basmgr/basicmanagerrepository.cxx @@ -81,7 +81,6 @@ namespace basic ImplRepository(); private: - ::osl::Mutex m_aMutex; BasicManagerStore m_aStore; CreationListeners m_aCreationListeners; @@ -222,7 +221,7 @@ namespace basic BasicManager* ImplRepository::getDocumentBasicManager( const Reference< XModel >& _rxDocumentModel ) { - ::osl::MutexGuard aGuard( m_aMutex ); + SolarMutexGuard g; /* #163556# (DR) - This function may be called recursively while constructing the Basic manager and loading the Basic storage. By @@ -242,7 +241,7 @@ namespace basic BasicManager* ImplRepository::getApplicationBasicManager( bool _bCreate ) { - ::osl::MutexGuard aGuard( m_aMutex ); + SolarMutexGuard g; BasicManager* pAppManager = GetSbData()->pAppBasMgr; if ( ( pAppManager == NULL ) && _bCreate ) @@ -254,7 +253,7 @@ namespace basic void ImplRepository::setApplicationBasicManager( BasicManager* _pBasicManager ) { - ::osl::MutexGuard aGuard( m_aMutex ); + SolarMutexGuard g; BasicManager* pPreviousManager = getApplicationBasicManager( false ); delete pPreviousManager; @@ -265,7 +264,8 @@ namespace basic BasicManager* ImplRepository::impl_createApplicationBasicManager() { - ::osl::MutexGuard aGuard( m_aMutex ); + SolarMutexGuard g; + OSL_PRECOND( getApplicationBasicManager( false ) == NULL, "ImplRepository::impl_createApplicationBasicManager: there already is one!" ); // Determine Directory @@ -324,14 +324,16 @@ namespace basic void ImplRepository::registerCreationListener( BasicManagerCreationListener& _rListener ) { - ::osl::MutexGuard aGuard( m_aMutex ); + SolarMutexGuard g; + m_aCreationListeners.push_back( &_rListener ); } void ImplRepository::revokeCreationListener( BasicManagerCreationListener& _rListener ) { - ::osl::MutexGuard aGuard( m_aMutex ); + SolarMutexGuard g; + CreationListeners::iterator pos = ::std::find( m_aCreationListeners.begin(), m_aCreationListeners.end(), &_rListener ); if ( pos != m_aCreationListeners.end() ) m_aCreationListeners.erase( pos ); @@ -542,7 +544,7 @@ namespace basic void ImplRepository::_disposing( const ::com::sun::star::lang::EventObject& _rSource ) { - ::osl::MutexGuard aGuard( m_aMutex ); + SolarMutexGuard g; Reference< XInterface > xNormalizedSource( _rSource.Source, UNO_QUERY ); #if OSL_DEBUG_LEVEL > 0 |