diff options
Diffstat (limited to 'comphelper')
-rw-r--r-- | comphelper/source/misc/accessibleeventnotifier.cxx | 16 | ||||
-rw-r--r-- | comphelper/source/misc/compbase.cxx | 4 | ||||
-rw-r--r-- | comphelper/source/misc/instancelocker.cxx | 8 |
3 files changed, 14 insertions, 14 deletions
diff --git a/comphelper/source/misc/accessibleeventnotifier.cxx b/comphelper/source/misc/accessibleeventnotifier.cxx index c1e26c35bdd9..f8bd5a1170e8 100644 --- a/comphelper/source/misc/accessibleeventnotifier.cxx +++ b/comphelper/source/misc/accessibleeventnotifier.cxx @@ -209,7 +209,7 @@ void AccessibleEventNotifier::revokeClientNotifyDisposing( sal_Int32 AccessibleEventNotifier::addEventListener( const TClientId _nClient, const Reference< XAccessibleEventListener >& _rxListener ) { - std::scoped_lock aGuard( GetLocalMutex() ); + std::unique_lock aGuard( GetLocalMutex() ); ClientMap::iterator aClientPos; if ( !implLookupClient( _nClient, aClientPos ) ) @@ -217,15 +217,15 @@ sal_Int32 AccessibleEventNotifier::addEventListener( return 0; if ( _rxListener.is() ) - aClientPos->second->addInterface( _rxListener ); + aClientPos->second->addInterface( aGuard, _rxListener ); - return aClientPos->second->getLength(); + return aClientPos->second->getLength(aGuard); } sal_Int32 AccessibleEventNotifier::removeEventListener( const TClientId _nClient, const Reference< XAccessibleEventListener >& _rxListener ) { - std::scoped_lock aGuard( GetLocalMutex() ); + std::unique_lock aGuard( GetLocalMutex() ); ClientMap::iterator aClientPos; if ( !implLookupClient( _nClient, aClientPos ) ) @@ -233,9 +233,9 @@ sal_Int32 AccessibleEventNotifier::removeEventListener( return 0; if ( _rxListener.is() ) - aClientPos->second->removeInterface( _rxListener ); + aClientPos->second->removeInterface( aGuard, _rxListener ); - return aClientPos->second->getLength(); + return aClientPos->second->getLength(aGuard); } void AccessibleEventNotifier::addEvent( const TClientId _nClient, const AccessibleEventObject& _rEvent ) @@ -243,7 +243,7 @@ void AccessibleEventNotifier::addEvent( const TClientId _nClient, const Accessib std::vector< Reference< XAccessibleEventListener > > aListeners; { - std::scoped_lock aGuard( GetLocalMutex() ); + std::unique_lock aGuard( GetLocalMutex() ); ClientMap::iterator aClientPos; if ( !implLookupClient( _nClient, aClientPos ) ) @@ -251,7 +251,7 @@ void AccessibleEventNotifier::addEvent( const TClientId _nClient, const Accessib return; // since we're synchronous, again, we want to notify immediately - aListeners = aClientPos->second->getElements(); + aListeners = aClientPos->second->getElements(aGuard); } // default handling: loop through all listeners, and notify them diff --git a/comphelper/source/misc/compbase.cxx b/comphelper/source/misc/compbase.cxx index ff3c4778b2ba..f8a8897b7bb7 100644 --- a/comphelper/source/misc/compbase.cxx +++ b/comphelper/source/misc/compbase.cxx @@ -37,14 +37,14 @@ void SAL_CALL WeakComponentImplHelperBase::addEventListener( std::unique_lock aGuard(m_aMutex); if (m_bDisposed) return; - maEventListeners.addInterface(rxListener); + maEventListeners.addInterface(aGuard, rxListener); } void SAL_CALL WeakComponentImplHelperBase::removeEventListener( css::uno::Reference<css::lang::XEventListener> const& rxListener) { std::unique_lock aGuard(m_aMutex); - maEventListeners.removeInterface(rxListener); + maEventListeners.removeInterface(aGuard, rxListener); } css::uno::Any SAL_CALL WeakComponentImplHelperBase::queryInterface(css::uno::Type const& rType) diff --git a/comphelper/source/misc/instancelocker.cxx b/comphelper/source/misc/instancelocker.cxx index a24572c6c865..347ff513cb6e 100644 --- a/comphelper/source/misc/instancelocker.cxx +++ b/comphelper/source/misc/instancelocker.cxx @@ -87,18 +87,18 @@ void SAL_CALL OInstanceLocker::dispose() void SAL_CALL OInstanceLocker::addEventListener( const uno::Reference< lang::XEventListener >& xListener ) { - std::scoped_lock aGuard( m_aMutex ); + std::unique_lock aGuard( m_aMutex ); if ( m_bDisposed ) throw lang::DisposedException(); // TODO - m_aListenersContainer.addInterface( xListener ); + m_aListenersContainer.addInterface( aGuard, xListener ); } void SAL_CALL OInstanceLocker::removeEventListener( const uno::Reference< lang::XEventListener >& xListener ) { - std::scoped_lock aGuard( m_aMutex ); - m_aListenersContainer.removeInterface( xListener ); + std::unique_lock aGuard( m_aMutex ); + m_aListenersContainer.removeInterface( aGuard, xListener ); } // XInitialization |