Kaydet (Commit) 5a824268 authored tarafından Mike Kaganski's avatar Mike Kaganski

Don't use resettable/clearable guard where plain guard is enough

Also use scope where possible. This allows to limit guard scope at
language level; visualises the scope clearly; and helps avoiding
errors like fixed in commit 61e4437c.

Change-Id: Ifeca96e2df8e8a0897770d9546b2536806275f41
Reviewed-on: https://gerrit.libreoffice.org/70376
Tested-by: Jenkins
Reviewed-by: 's avatarMike Kaganski <mike.kaganski@collabora.com>
üst a6186a67
......@@ -799,19 +799,19 @@ IMPL_TextlistItem* ProgressMonitor::impl_searchTopic ( const OUString& rTopic, b
::std::vector< std::unique_ptr<IMPL_TextlistItem> >* pTextList;
// Ready for multithreading
ClearableMutexGuard aGuard ( m_aMutex );
if ( bbeforeProgress )
{
pTextList = &maTextlist_Top;
}
else
{
pTextList = &maTextlist_Bottom;
}
MutexGuard aGuard(m_aMutex);
if (bbeforeProgress)
{
pTextList = &maTextlist_Top;
}
else
{
pTextList = &maTextlist_Bottom;
}
}
// Switch off guard.
aGuard.clear ();
// Search the topic in textlist.
size_t nPosition = 0;
......
......@@ -414,7 +414,7 @@ tools::Rectangle AccessibleBrowseBoxBase::getBoundingBoxOnScreen()
void AccessibleBrowseBoxBase::commitEvent(
sal_Int16 _nEventId, const Any& _rNewValue, const Any& _rOldValue )
{
::osl::ClearableMutexGuard aGuard( getMutex() );
osl::MutexGuard aGuard( getMutex() );
if ( !getClientId( ) )
// if we don't have a client id for the notifier, then we don't have listeners, then
// we don't need to notify anything
......
......@@ -589,7 +589,7 @@ void SAL_CALL Paragraph::removeAccessibleEventListener(
{
comphelper::AccessibleEventNotifier::TClientId nId = 0;
{
::osl::ClearableMutexGuard aGuard(rBHelper.rMutex);
osl::MutexGuard aGuard(rBHelper.rMutex);
if (rListener.is() && m_nClientId != 0
&& comphelper::AccessibleEventNotifier::removeEventListener( m_nClientId, rListener ) == 0)
{
......@@ -612,7 +612,7 @@ void SAL_CALL Paragraph::disposing()
{
comphelper::AccessibleEventNotifier::TClientId nId = 0;
{
::osl::ClearableMutexGuard aGuard(rBHelper.rMutex);
osl::MutexGuard aGuard(rBHelper.rMutex);
nId = m_nClientId;
m_nClientId = 0;
}
......
......@@ -56,7 +56,6 @@ using ::com::sun::star::uno::UNO_QUERY;
using ::com::sun::star::uno::Reference;
using ::osl::MutexGuard;
using ::osl::ClearableMutexGuard;
using ::osl::ResettableMutexGuard;
using ::com::sun::star::uno::Any;
namespace chart
......@@ -412,29 +411,31 @@ void AccessibleBase::SetInfo( const AccessibleElementInfo & rNewInfo )
// ________ (XComponent::dispose) ________
void SAL_CALL AccessibleBase::disposing()
{
ClearableMutexGuard aGuard( GetMutex() );
OSL_ENSURE( ! m_bIsDisposed, "dispose() called twice" );
// notify disposing to all AccessibleEvent listeners asynchron
if ( m_nEventNotifierId )
{
::comphelper::AccessibleEventNotifier::revokeClientNotifyDisposing( m_nEventNotifierId, *this );
m_nEventNotifierId = 0;
}
MutexGuard aGuard(GetMutex());
OSL_ENSURE(!m_bIsDisposed, "dispose() called twice");
// notify disposing to all AccessibleEvent listeners asynchron
if (m_nEventNotifierId)
{
::comphelper::AccessibleEventNotifier::revokeClientNotifyDisposing(m_nEventNotifierId,
*this);
m_nEventNotifierId = 0;
}
// reset pointers
m_aAccInfo.m_pParent = nullptr;
// reset pointers
m_aAccInfo.m_pParent = nullptr;
// attach new empty state set helper to member reference
::utl::AccessibleStateSetHelper * pHelper = new ::utl::AccessibleStateSetHelper();
pHelper->AddState( AccessibleStateType::DEFUNC );
// release old helper and attach new one
m_xStateSetHelper = pHelper;
// attach new empty state set helper to member reference
::utl::AccessibleStateSetHelper * pHelper = new ::utl::AccessibleStateSetHelper();
pHelper->AddState(AccessibleStateType::DEFUNC);
// release old helper and attach new one
m_xStateSetHelper = pHelper;
m_bIsDisposed = true;
m_bIsDisposed = true;
}
// call listeners unguarded
aGuard.clear();
if( m_bMayHaveChildren )
{
......@@ -480,7 +481,7 @@ Reference< XAccessible > SAL_CALL AccessibleBase::getAccessibleChild( sal_Int32
CheckDisposeState();
Reference< XAccessible > xResult;
ResettableMutexGuard aGuard( GetMutex() );
ClearableMutexGuard aGuard( GetMutex() );
bool bMustUpdateChildren = ( m_bMayHaveChildren &&
! m_bChildrenInitialized );
......
......@@ -2453,7 +2453,7 @@ void ChartView::createShapes()
{
SolarMutexGuard aSolarGuard;
osl::ResettableMutexGuard aTimedGuard(maTimeMutex);
osl::MutexGuard aTimedGuard(maTimeMutex);
if(mrChartModel.isTimeBased())
{
maTimeBased.bTimeBased = true;
......@@ -2927,7 +2927,7 @@ OUString ChartView::dump()
void ChartView::setViewDirty()
{
osl::ResettableMutexGuard aGuard(maTimeMutex);
osl::MutexGuard aGuard(maTimeMutex);
m_bViewDirty = true;
}
......
......@@ -53,7 +53,7 @@ OEnumerationByName::~OEnumerationByName()
sal_Bool SAL_CALL OEnumerationByName::hasMoreElements( )
{
::osl::ResettableMutexGuard aLock(m_aLock);
osl::MutexGuard aLock(m_aLock);
if (m_xAccess.is() && m_aNames.getLength() > m_nPos)
return true;
......@@ -70,7 +70,7 @@ sal_Bool SAL_CALL OEnumerationByName::hasMoreElements( )
css::uno::Any SAL_CALL OEnumerationByName::nextElement( )
{
::osl::ResettableMutexGuard aLock(m_aLock);
osl::MutexGuard aLock(m_aLock);
css::uno::Any aRes;
if (m_xAccess.is() && m_nPos < m_aNames.getLength())
......@@ -91,7 +91,7 @@ css::uno::Any SAL_CALL OEnumerationByName::nextElement( )
void SAL_CALL OEnumerationByName::disposing(const css::lang::EventObject& aEvent)
{
::osl::ResettableMutexGuard aLock(m_aLock);
osl::MutexGuard aLock(m_aLock);
if (aEvent.Source == m_xAccess)
m_xAccess.clear();
......@@ -100,7 +100,7 @@ void SAL_CALL OEnumerationByName::disposing(const css::lang::EventObject& aEvent
void OEnumerationByName::impl_startDisposeListening()
{
::osl::ResettableMutexGuard aLock(m_aLock);
osl::MutexGuard aLock(m_aLock);
if (m_bListening)
return;
......@@ -118,7 +118,7 @@ void OEnumerationByName::impl_startDisposeListening()
void OEnumerationByName::impl_stopDisposeListening()
{
::osl::ResettableMutexGuard aLock(m_aLock);
osl::MutexGuard aLock(m_aLock);
if (!m_bListening)
return;
......@@ -150,7 +150,7 @@ OEnumerationByIndex::~OEnumerationByIndex()
sal_Bool SAL_CALL OEnumerationByIndex::hasMoreElements( )
{
::osl::ResettableMutexGuard aLock(m_aLock);
osl::MutexGuard aLock(m_aLock);
if (m_xAccess.is() && m_xAccess->getCount() > m_nPos)
return true;
......@@ -167,7 +167,7 @@ sal_Bool SAL_CALL OEnumerationByIndex::hasMoreElements( )
css::uno::Any SAL_CALL OEnumerationByIndex::nextElement( )
{
::osl::ResettableMutexGuard aLock(m_aLock);
osl::MutexGuard aLock(m_aLock);
css::uno::Any aRes;
if (m_xAccess.is() && m_nPos < m_xAccess->getCount())
......@@ -187,7 +187,7 @@ css::uno::Any SAL_CALL OEnumerationByIndex::nextElement( )
void SAL_CALL OEnumerationByIndex::disposing(const css::lang::EventObject& aEvent)
{
::osl::ResettableMutexGuard aLock(m_aLock);
osl::MutexGuard aLock(m_aLock);
if (aEvent.Source == m_xAccess)
m_xAccess.clear();
......@@ -196,7 +196,7 @@ void SAL_CALL OEnumerationByIndex::disposing(const css::lang::EventObject& aEven
void OEnumerationByIndex::impl_startDisposeListening()
{
::osl::ResettableMutexGuard aLock(m_aLock);
osl::MutexGuard aLock(m_aLock);
if (m_bListening)
return;
......@@ -214,7 +214,7 @@ void OEnumerationByIndex::impl_startDisposeListening()
void OEnumerationByIndex::impl_stopDisposeListening()
{
::osl::ResettableMutexGuard aLock(m_aLock);
osl::MutexGuard aLock(m_aLock);
if (!m_bListening)
return;
......@@ -243,7 +243,7 @@ OAnyEnumeration::~OAnyEnumeration()
sal_Bool SAL_CALL OAnyEnumeration::hasMoreElements( )
{
::osl::ResettableMutexGuard aLock(m_aLock);
osl::MutexGuard aLock(m_aLock);
return (m_lItems.getLength() > m_nPos);
}
......@@ -254,7 +254,7 @@ css::uno::Any SAL_CALL OAnyEnumeration::nextElement( )
if ( ! hasMoreElements())
throw css::container::NoSuchElementException();
::osl::ResettableMutexGuard aLock(m_aLock);
osl::MutexGuard aLock(m_aLock);
sal_Int32 nPos = m_nPos;
++m_nPos;
return m_lItems[nPos];
......
......@@ -211,7 +211,7 @@ OLockListener::~OLockListener()
void OLockListener::Dispose()
{
::osl::ResettableMutexGuard aGuard( m_aMutex );
osl::MutexGuard aGuard( m_aMutex );
if ( m_bDisposed )
return;
......@@ -251,7 +251,7 @@ void OLockListener::Dispose()
void SAL_CALL OLockListener::disposing( const lang::EventObject& aEvent )
{
::osl::ResettableMutexGuard aGuard( m_aMutex );
osl::ClearableMutexGuard aGuard( m_aMutex );
// object is disposed
if ( aEvent.Source == m_xInstance )
......@@ -276,7 +276,7 @@ void SAL_CALL OLockListener::disposing( const lang::EventObject& aEvent )
void SAL_CALL OLockListener::queryClosing( const lang::EventObject& aEvent, sal_Bool )
{
// GetsOwnership parameter is always ignored, the user of the service must close the object always
::osl::ResettableMutexGuard aGuard( m_aMutex );
osl::ClearableMutexGuard aGuard( m_aMutex );
if ( !m_bDisposed && aEvent.Source == m_xInstance && ( m_nMode & embed::Actions::PREVENT_CLOSE ) )
{
try
......@@ -304,7 +304,7 @@ void SAL_CALL OLockListener::queryClosing( const lang::EventObject& aEvent, sal_
void SAL_CALL OLockListener::notifyClosing( const lang::EventObject& aEvent )
{
::osl::ResettableMutexGuard aGuard( m_aMutex );
osl::ClearableMutexGuard aGuard( m_aMutex );
// object is closed, no reason to listen
if ( aEvent.Source == m_xInstance )
......@@ -334,7 +334,7 @@ void SAL_CALL OLockListener::notifyClosing( const lang::EventObject& aEvent )
void SAL_CALL OLockListener::queryTermination( const lang::EventObject& aEvent )
{
::osl::ResettableMutexGuard aGuard( m_aMutex );
osl::ClearableMutexGuard aGuard( m_aMutex );
if ( aEvent.Source == m_xInstance && ( m_nMode & embed::Actions::PREVENT_TERMINATION ) )
{
try
......@@ -362,7 +362,7 @@ void SAL_CALL OLockListener::queryTermination( const lang::EventObject& aEvent )
void SAL_CALL OLockListener::notifyTermination( const lang::EventObject& aEvent )
{
::osl::ResettableMutexGuard aGuard( m_aMutex );
osl::ClearableMutexGuard aGuard( m_aMutex );
// object is terminated, no reason to listen
if ( aEvent.Source == m_xInstance )
......@@ -397,7 +397,7 @@ void SAL_CALL OLockListener::notifyTermination( const lang::EventObject& aEvent
void OLockListener::Init()
{
::osl::ResettableMutexGuard aGuard( m_aMutex );
osl::ClearableMutexGuard aGuard( m_aMutex );
if ( m_bDisposed || m_bInitialized )
return;
......
......@@ -44,7 +44,7 @@ NumberedCollection::~NumberedCollection()
void NumberedCollection::setOwner(const css::uno::Reference< css::uno::XInterface >& xOwner)
{
// SYNCHRONIZED ->
::osl::ResettableMutexGuard aLock(m_aMutex);
osl::MutexGuard aLock(m_aMutex);
m_xOwner = xOwner;
......@@ -55,7 +55,7 @@ void NumberedCollection::setOwner(const css::uno::Reference< css::uno::XInterfac
void NumberedCollection::setUntitledPrefix(const OUString& sPrefix)
{
// SYNCHRONIZED ->
::osl::ResettableMutexGuard aLock(m_aMutex);
osl::MutexGuard aLock(m_aMutex);
m_sUntitledPrefix = sPrefix;
......@@ -66,7 +66,7 @@ void NumberedCollection::setUntitledPrefix(const OUString& sPrefix)
::sal_Int32 SAL_CALL NumberedCollection::leaseNumber(const css::uno::Reference< css::uno::XInterface >& xComponent)
{
// SYNCHRONIZED ->
::osl::ResettableMutexGuard aLock(m_aMutex);
osl::MutexGuard aLock(m_aMutex);
if ( ! xComponent.is ())
throw css::lang::IllegalArgumentException(ERRMSG_INVALID_COMPONENT_PARAM, m_xOwner.get(), 1);
......@@ -101,7 +101,7 @@ void NumberedCollection::setUntitledPrefix(const OUString& sPrefix)
void SAL_CALL NumberedCollection::releaseNumber(::sal_Int32 nNumber)
{
// SYNCHRONIZED ->
::osl::ResettableMutexGuard aLock(m_aMutex);
osl::MutexGuard aLock(m_aMutex);
if (nNumber == css::frame::UntitledNumbersConst::INVALID_NUMBER)
throw css::lang::IllegalArgumentException ("Special valkud INVALID_NUMBER not allowed as input parameter.", m_xOwner.get(), 1);
......@@ -138,7 +138,7 @@ void SAL_CALL NumberedCollection::releaseNumber(::sal_Int32 nNumber)
void SAL_CALL NumberedCollection::releaseNumberForComponent(const css::uno::Reference< css::uno::XInterface >& xComponent)
{
// SYNCHRONIZED ->
::osl::ResettableMutexGuard aLock(m_aMutex);
osl::MutexGuard aLock(m_aMutex);
if ( ! xComponent.is ())
throw css::lang::IllegalArgumentException(ERRMSG_INVALID_COMPONENT_PARAM, m_xOwner.get(), 1);
......@@ -160,7 +160,7 @@ void SAL_CALL NumberedCollection::releaseNumberForComponent(const css::uno::Refe
OUString SAL_CALL NumberedCollection::getUntitledPrefix()
{
// SYNCHRONIZED ->
::osl::ResettableMutexGuard aLock(m_aMutex);
osl::MutexGuard aLock(m_aMutex);
return m_sUntitledPrefix;
......@@ -195,8 +195,8 @@ OUString SAL_CALL NumberedCollection::getUntitledPrefix()
lPossibleNumbers.push_back (i);
// SYNCHRONIZED ->
::osl::ResettableMutexGuard aLock(m_aMutex);
{
osl::MutexGuard aLock(m_aMutex);
TDeadItemList lDeadItems;
for (const auto& [rComponent, rItem] : m_lComponents)
......
......@@ -117,7 +117,7 @@ void SAL_CALL GenericPropertySet::addPropertyChangeListener( const OUString& aPr
void SAL_CALL GenericPropertySet::removePropertyChangeListener( const OUString& aPropertyName, const Reference< XPropertyChangeListener >& xListener )
{
ResettableMutexGuard aGuard( maMutex );
ClearableMutexGuard aGuard( maMutex );
Reference < XPropertySetInfo > xInfo = getPropertySetInfo( );
aGuard.clear();
if ( xInfo.is() )
......
......@@ -208,21 +208,21 @@ namespace comphelper
if ( !( _element >>= aProperty ) )
throw IllegalArgumentException( OUString(), *this, 1 );
::osl::ClearableMutexGuard g( m_aMutex );
// check whether the type is allowed, everything else will be checked
// by m_aDynamicProperties
if ( !m_aAllowedTypes.empty()
&& m_aAllowedTypes.find( aProperty.Type ) == m_aAllowedTypes.end()
)
throw IllegalArgumentException( OUString(), *this, 1 );
{
osl::MutexGuard g(m_aMutex);
m_aDynamicProperties.addVoidProperty( aProperty.Name, aProperty.Type, findFreeHandle(), aProperty.Attributes );
// check whether the type is allowed, everything else will be checked
// by m_aDynamicProperties
if (!m_aAllowedTypes.empty()
&& m_aAllowedTypes.find(aProperty.Type) == m_aAllowedTypes.end())
throw IllegalArgumentException(OUString(), *this, 1);
// our property info is dirty
m_pArrayHelper.reset();
m_aDynamicProperties.addVoidProperty(aProperty.Name, aProperty.Type, findFreeHandle(),
aProperty.Attributes);
g.clear();
// our property info is dirty
m_pArrayHelper.reset();
}
setModified(true);
}
......@@ -312,37 +312,36 @@ namespace comphelper
void SAL_CALL OPropertyBag::addProperty( const OUString& _rName, ::sal_Int16 _nAttributes, const Any& _rInitialValue )
{
::osl::ClearableMutexGuard g( m_aMutex );
// check whether the type is allowed, everything else will be checked
// by m_aDynamicProperties
const Type& aPropertyType = _rInitialValue.getValueType();
if ( _rInitialValue.hasValue()
&& !m_aAllowedTypes.empty()
&& m_aAllowedTypes.find( aPropertyType ) == m_aAllowedTypes.end()
)
throw IllegalTypeException( OUString(), *this );
{
osl::MutexGuard g(m_aMutex);
m_aDynamicProperties.addProperty( _rName, findFreeHandle(), _nAttributes, _rInitialValue );
// check whether the type is allowed, everything else will be checked
// by m_aDynamicProperties
const Type& aPropertyType = _rInitialValue.getValueType();
if (_rInitialValue.hasValue() && !m_aAllowedTypes.empty()
&& m_aAllowedTypes.find(aPropertyType) == m_aAllowedTypes.end())
throw IllegalTypeException(OUString(), *this);
// our property info is dirty
m_pArrayHelper.reset();
m_aDynamicProperties.addProperty(_rName, findFreeHandle(), _nAttributes,
_rInitialValue);
g.clear();
// our property info is dirty
m_pArrayHelper.reset();
}
setModified(true);
}
void SAL_CALL OPropertyBag::removeProperty( const OUString& _rName )
{
::osl::ClearableMutexGuard g( m_aMutex );
m_aDynamicProperties.removeProperty( _rName );
{
osl::MutexGuard g(m_aMutex);
// our property info is dirty
m_pArrayHelper.reset();
m_aDynamicProperties.removeProperty(_rName);
g.clear();
// our property info is dirty
m_pArrayHelper.reset();
}
setModified(true);
}
......
......@@ -307,7 +307,7 @@ void OStatementBase::clearWarnings()
void OStatementBase::cancel()
{
// no blocking as cancel is typically called from a different thread
ClearableMutexGuard aCancelGuard(m_aCancelMutex);
MutexGuard aCancelGuard(m_aCancelMutex);
if (m_xAggregateAsCancellable.is())
m_xAggregateAsCancellable->cancel();
// else do nothing
......
......@@ -1804,52 +1804,54 @@ void ODatabaseDocument::disposing()
std::vector< Reference< XInterface > > aKeepAlive;
// SYNCHRONIZED ->
SolarMutexClearableGuard aGuard;
OSL_ENSURE( m_aControllers.empty(), "ODatabaseDocument::disposing: there still are controllers!" );
// normally, nobody should explicitly dispose, but only XCloseable::close
// the document. And upon closing, our controllers are closed, too
{
uno::Reference<uno::XInterface> xUIInterface( m_xUIConfigurationManager );
aKeepAlive.push_back( xUIInterface );
}
m_xUIConfigurationManager = nullptr;
SolarMutexGuard aGuard;
clearObjectContainer( m_xForms );
clearObjectContainer( m_xReports );
OSL_ENSURE(m_aControllers.empty(),
"ODatabaseDocument::disposing: there still are controllers!");
// normally, nobody should explicitly dispose, but only XCloseable::close
// the document. And upon closing, our controllers are closed, too
// reset the macro mode: in case the our impl struct stays alive (e.g. because our DataSource
// object still exists), and somebody subsequently re-opens the document, we want to have
// the security warning, again.
m_pImpl->resetMacroExecutionMode();
{
uno::Reference<uno::XInterface> xUIInterface(m_xUIConfigurationManager);
aKeepAlive.push_back(xUIInterface);
}
m_xUIConfigurationManager = nullptr;
// similar arguing for our ViewMonitor
m_aViewMonitor.reset();
clearObjectContainer(m_xForms);
clearObjectContainer(m_xReports);
// tell our Impl to forget us
m_pImpl->modelIsDisposing( impl_isInitialized(), ODatabaseModelImpl::ResetModelAccess() );
// reset the macro mode: in case the our impl struct stays alive (e.g. because our DataSource
// object still exists), and somebody subsequently re-opens the document, we want to have
// the security warning, again.
m_pImpl->resetMacroExecutionMode();
// now, at the latest, the controller array should be empty. Controllers are
// expected to listen for our disposal, and disconnect then
OSL_ENSURE( m_aControllers.empty(), "ODatabaseDocument::disposing: there still are controllers!" );
impl_disposeControllerFrames_nothrow();
// similar arguing for our ViewMonitor
m_aViewMonitor.reset();
{
uno::Reference<uno::XInterface> xModuleInterface( m_xModuleManager );
aKeepAlive.push_back( xModuleInterface );
}
m_xModuleManager.clear();
// tell our Impl to forget us
m_pImpl->modelIsDisposing(impl_isInitialized(), ODatabaseModelImpl::ResetModelAccess());
{
uno::Reference<uno::XInterface> xTitleInterface( m_xTitleHelper );
aKeepAlive.push_back( xTitleInterface );
}
m_xTitleHelper.clear();
// now, at the latest, the controller array should be empty. Controllers are
// expected to listen for our disposal, and disconnect then
OSL_ENSURE(m_aControllers.empty(),
"ODatabaseDocument::disposing: there still are controllers!");
impl_disposeControllerFrames_nothrow();
m_pImpl.clear();
{
uno::Reference<uno::XInterface> xModuleInterface(m_xModuleManager);
aKeepAlive.push_back(xModuleInterface);
}
m_xModuleManager.clear();
aGuard.clear();
{
uno::Reference<uno::XInterface> xTitleInterface(m_xTitleHelper);
aKeepAlive.push_back(xTitleInterface);
}
m_xTitleHelper.clear();
m_pImpl.clear();
}
// <- SYNCHRONIZED
aKeepAlive.clear();
......
......@@ -605,7 +605,7 @@ void ODefinitionContainer::approveNewObject(const OUString& _sName,const Referen
// XPropertyChangeListener
void SAL_CALL ODefinitionContainer::propertyChange( const PropertyChangeEvent& evt )
{
ClearableMutexGuard aGuard(m_aMutex);
MutexGuard aGuard(m_aMutex);
if( evt.PropertyName == PROPERTY_NAME || evt.PropertyName == "Title" )
{
m_bInPropertyChange = true;
......
......@@ -565,7 +565,7 @@ void SAL_CALL ODocumentContainer::insertByHierarchicalName( const OUString& _sNa
if ( !xContent.is() )
throw IllegalArgumentException();
ClearableMutexGuard aGuard(m_aMutex);
MutexGuard aGuard(m_aMutex);
Any aContent;
Reference< XNameContainer > xNameContainer(this);
OUString sName;
......@@ -589,7 +589,7 @@ void SAL_CALL ODocumentContainer::removeByHierarchicalName( const OUString& _sNa
if ( _sName.isEmpty() )
throw NoSuchElementException(_sName,*this);
ClearableMutexGuard aGuard(m_aMutex);
MutexGuard aGuard(m_aMutex);
Any aContent;
OUString sName;
Reference< XNameContainer > xNameContainer(this);
......@@ -606,7 +606,7 @@ void SAL_CALL ODocumentContainer::replaceByHierarchicalName( const OUString& _sN
if ( !xContent.is() )
throw IllegalArgumentException();
ClearableMutexGuard aGuard(m_aMutex);
MutexGuard aGuard(m_aMutex);
Any aContent;
OUString sName;
Reference< XNameContainer > xNameContainer(this);
......
......@@ -959,7 +959,7 @@ Any SAL_CALL ODocumentDefinition::execute( const Command& aCommand, sal_Int32 Co
// making it release the own mutex before calling SolarMutex-code is ... difficult, at least.
// So, to be on the same side, we lock the SolarMutex here. Yes, it sucks.
::SolarMutexGuard aSolarGuard;
::osl::ClearableMutexGuard aGuard(m_aMutex);
osl::MutexGuard aGuard(m_aMutex);
if ( m_bInExecute )
return aRet;
......@@ -994,7 +994,7 @@ Any SAL_CALL ODocumentDefinition::execute( const Command& aCommand, sal_Int32 Co
return onCommandOpenSomething( aCommand.Argument, bActivateObject, Environment );
}
::osl::ClearableMutexGuard aGuard(m_aMutex);
osl::MutexGuard aGuard(m_aMutex);
if ( m_bInExecute )
return aRet;
......
......@@ -128,7 +128,7 @@ namespace dbaui
virtual ::framework::IMutex& getGuardedMutex() override;
private:
::osl::ResettableMutexGuard m_aGuard;
osl::ClearableMutexGuard m_aGuard;
OslMutexFacade m_aMutexFacade;
};
......
......@@ -406,7 +406,7 @@ bool DispatchWatcher::executeDispatchRequests( const std::vector<DispatchRequest
if( xDispatcher.is() )
{
{
::osl::ClearableMutexGuard aGuard(m_mutex);
osl::MutexGuard aGuard(m_mutex);
// Remember request so we can find it in statusChanged!
m_nRequestCount++;
}
......@@ -754,9 +754,10 @@ bool DispatchWatcher::executeDispatchRequests( const std::vector<DispatchRequest
xDisp->dispatchWithNotification( aDispatche.aURL, aArgs, this );
else
{
::osl::ClearableMutexGuard aGuard(m_mutex);
m_nRequestCount--;
aGuard.clear();
{
osl::MutexGuard aGuard(m_mutex);
m_nRequestCount--;
}
xDispatch->dispatch( aDispatche.aURL, aArgs );
}
}
......
......@@ -920,38 +920,39 @@ void ExtensionBox_Impl::addEntry( const uno::Reference< deployment::XPackage > &
if ( pEntry->m_sTitle.isEmpty() )
return;
::osl::ClearableMutexGuard guard(m_entriesMutex);
if ( m_vEntries.empty() )