Consolidate on C++17 std::scoped_lock instead of std::lock_guard

as in commit 9376f65a26

Change-Id: I3ad9afd4d113582a214a4a4bc7eea55e38cd6ff9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119927
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
Noel Grandin
2021-08-03 12:20:53 +02:00
parent 5afdcad4c0
commit 05ab38359a
97 changed files with 439 additions and 439 deletions
+3 -3
View File
@@ -37,12 +37,12 @@ OutgoingRequests::~OutgoingRequests() {}
void OutgoingRequests::push(
rtl::ByteSequence const & tid, OutgoingRequest const & request)
{
std::lock_guard g(mutex_);
std::scoped_lock g(mutex_);
map_[tid].push_back(request);
}
OutgoingRequest OutgoingRequests::top(rtl::ByteSequence const & tid) {
std::lock_guard g(mutex_);
std::scoped_lock g(mutex_);
Map::iterator i(map_.find(tid));
if (i == map_.end()) {
throw css::uno::RuntimeException(
@@ -53,7 +53,7 @@ OutgoingRequest OutgoingRequests::top(rtl::ByteSequence const & tid) {
}
void OutgoingRequests::pop(rtl::ByteSequence const & tid) noexcept {
std::lock_guard g(mutex_);
std::scoped_lock g(mutex_);
Map::iterator i(map_.find(tid));
assert(i != map_.end());
i->second.pop_back();
@@ -214,7 +214,7 @@ VtableFactory::VtableFactory(): m_arena(
VtableFactory::~VtableFactory() {
{
std::lock_guard guard(m_mutex);
std::scoped_lock guard(m_mutex);
for (const auto& rEntry : m_map) {
for (sal_Int32 j = 0; j < rEntry.second.count; ++j) {
freeBlock(rEntry.second.blocks[j]);
@@ -228,7 +228,7 @@ const VtableFactory::Vtables& VtableFactory::getVtables(
typelib_InterfaceTypeDescription * type)
{
OUString name(type->aBase.pTypeName);
std::lock_guard guard(m_mutex);
std::scoped_lock guard(m_mutex);
Map::iterator i(m_map.find(name));
if (i == m_map.end()) {
GuardedBlocks blocks(*this);
+1 -1
View File
@@ -288,7 +288,7 @@ Reference<XInterface> CanvasFactory::lookupAndUse(
OUString const & serviceName, Sequence<Any> const & args,
Reference<XComponentContext> const & xContext ) const
{
std::lock_guard guard(m_mutex);
std::scoped_lock guard(m_mutex);
// forcing last entry from impl list, if config flag set
bool bForceLastEntry(false);
@@ -80,7 +80,7 @@ NameContainer::NameContainer( const css::uno::Type& aType )
// XNameContainer
void SAL_CALL NameContainer::insertByName( const OUString& aName, const Any& aElement )
{
std::lock_guard aGuard( maMutex );
std::scoped_lock aGuard( maMutex );
if( maProperties.find( aName ) != maProperties.end() )
throw ElementExistException();
@@ -93,7 +93,7 @@ void SAL_CALL NameContainer::insertByName( const OUString& aName, const Any& aEl
void SAL_CALL NameContainer::removeByName( const OUString& Name )
{
std::lock_guard aGuard( maMutex );
std::scoped_lock aGuard( maMutex );
SvGenericNameContainerMapImpl::iterator aIter = maProperties.find( Name );
if( aIter == maProperties.end() )
@@ -106,7 +106,7 @@ void SAL_CALL NameContainer::removeByName( const OUString& Name )
void SAL_CALL NameContainer::replaceByName( const OUString& aName, const Any& aElement )
{
std::lock_guard aGuard( maMutex );
std::scoped_lock aGuard( maMutex );
SvGenericNameContainerMapImpl::iterator aIter( maProperties.find( aName ) );
if( aIter == maProperties.end() )
@@ -122,7 +122,7 @@ void SAL_CALL NameContainer::replaceByName( const OUString& aName, const Any& aE
Any SAL_CALL NameContainer::getByName( const OUString& aName )
{
std::lock_guard aGuard( maMutex );
std::scoped_lock aGuard( maMutex );
SvGenericNameContainerMapImpl::iterator aIter = maProperties.find( aName );
if( aIter == maProperties.end() )
@@ -133,14 +133,14 @@ Any SAL_CALL NameContainer::getByName( const OUString& aName )
Sequence< OUString > SAL_CALL NameContainer::getElementNames( )
{
std::lock_guard aGuard( maMutex );
std::scoped_lock aGuard( maMutex );
return comphelper::mapKeysToSequence(maProperties);
}
sal_Bool SAL_CALL NameContainer::hasByName( const OUString& aName )
{
std::lock_guard aGuard( maMutex );
std::scoped_lock aGuard( maMutex );
SvGenericNameContainerMapImpl::iterator aIter = maProperties.find( aName );
return aIter != maProperties.end();
@@ -148,7 +148,7 @@ sal_Bool SAL_CALL NameContainer::hasByName( const OUString& aName )
sal_Bool SAL_CALL NameContainer::hasElements( )
{
std::lock_guard aGuard( maMutex );
std::scoped_lock aGuard( maMutex );
return !maProperties.empty();
}
@@ -55,7 +55,7 @@ namespace comphelper
void OAccessibleKeyBindingHelper::AddKeyBinding( const Sequence< awt::KeyStroke >& rKeyBinding )
{
std::lock_guard aGuard( m_aMutex );
std::scoped_lock aGuard( m_aMutex );
m_aKeyBindings.push_back( rKeyBinding );
}
@@ -63,7 +63,7 @@ namespace comphelper
void OAccessibleKeyBindingHelper::AddKeyBinding( const awt::KeyStroke& rKeyStroke )
{
std::lock_guard aGuard( m_aMutex );
std::scoped_lock aGuard( m_aMutex );
m_aKeyBindings.push_back( { rKeyStroke } );
}
@@ -73,7 +73,7 @@ namespace comphelper
sal_Int32 OAccessibleKeyBindingHelper::getAccessibleKeyBindingCount()
{
std::lock_guard aGuard( m_aMutex );
std::scoped_lock aGuard( m_aMutex );
return m_aKeyBindings.size();
}
@@ -81,7 +81,7 @@ namespace comphelper
Sequence< awt::KeyStroke > OAccessibleKeyBindingHelper::getAccessibleKeyBinding( sal_Int32 nIndex )
{
std::lock_guard aGuard( m_aMutex );
std::scoped_lock aGuard( m_aMutex );
if ( nIndex < 0 || nIndex >= static_cast<sal_Int32>(m_aKeyBindings.size()) )
throw IndexOutOfBoundsException();
+3 -3
View File
@@ -88,7 +88,7 @@ namespace comphelper
void AsyncEventNotifierBase::removeEventsForProcessor( const ::rtl::Reference< IEventProcessor >& _xProcessor )
{
std::lock_guard aGuard( m_xImpl->aMutex );
std::scoped_lock aGuard( m_xImpl->aMutex );
// remove all events for this processor
m_xImpl->aEvents.erase(std::remove_if( m_xImpl->aEvents.begin(), m_xImpl->aEvents.end(), EqualProcessor( _xProcessor ) ), m_xImpl->aEvents.end());
@@ -97,7 +97,7 @@ namespace comphelper
void SAL_CALL AsyncEventNotifierBase::terminate()
{
std::lock_guard aGuard( m_xImpl->aMutex );
std::scoped_lock aGuard( m_xImpl->aMutex );
// remember the termination request
m_xImpl->bTerminate = true;
@@ -109,7 +109,7 @@ namespace comphelper
void AsyncEventNotifierBase::addEvent( const AnyEventRef& _rEvent, const ::rtl::Reference< IEventProcessor >& _xProcessor )
{
std::lock_guard aGuard( m_xImpl->aMutex );
std::scoped_lock aGuard( m_xImpl->aMutex );
// remember this event
m_xImpl->aEvents.emplace_back( ProcessableEvent {_rEvent, _xProcessor} );
@@ -53,7 +53,7 @@ sal_Int32 SAL_CALL OSLInputStreamWrapper::readBytes(css::uno::Sequence< sal_Int8
aData.realloc(nBytesToRead);
std::lock_guard aGuard( m_aMutex );
std::scoped_lock aGuard( m_aMutex );
sal_uInt64 nRead = 0;
FileBase::RC eError = m_pFile->read(static_cast<void*>(aData.getArray()), nBytesToRead, nRead);
@@ -80,7 +80,7 @@ sal_Int32 SAL_CALL OSLInputStreamWrapper::readSomeBytes(css::uno::Sequence< sal_
void SAL_CALL OSLInputStreamWrapper::skipBytes(sal_Int32 nBytesToSkip)
{
std::lock_guard aGuard( m_aMutex );
std::scoped_lock aGuard( m_aMutex );
if (!m_pFile)
throw css::io::NotConnectedException(OUString(), static_cast<css::uno::XWeak*>(this));
@@ -97,7 +97,7 @@ void SAL_CALL OSLInputStreamWrapper::skipBytes(sal_Int32 nBytesToSkip)
sal_Int32 SAL_CALL OSLInputStreamWrapper::available()
{
std::lock_guard aGuard( m_aMutex );
std::scoped_lock aGuard( m_aMutex );
if (!m_pFile)
throw css::io::NotConnectedException(OUString(), static_cast<css::uno::XWeak*>(this));
@@ -117,7 +117,7 @@ void OSeekableInputWrapper::PrepareCopy_Impl()
sal_Int32 SAL_CALL OSeekableInputWrapper::readBytes( uno::Sequence< sal_Int8 >& aData, sal_Int32 nBytesToRead )
{
std::lock_guard aGuard( m_aMutex );
std::scoped_lock aGuard( m_aMutex );
if ( !m_xOriginalStream.is() )
throw io::NotConnectedException();
@@ -130,7 +130,7 @@ sal_Int32 SAL_CALL OSeekableInputWrapper::readBytes( uno::Sequence< sal_Int8 >&
sal_Int32 SAL_CALL OSeekableInputWrapper::readSomeBytes( uno::Sequence< sal_Int8 >& aData, sal_Int32 nMaxBytesToRead )
{
std::lock_guard aGuard( m_aMutex );
std::scoped_lock aGuard( m_aMutex );
if ( !m_xOriginalStream.is() )
throw io::NotConnectedException();
@@ -143,7 +143,7 @@ sal_Int32 SAL_CALL OSeekableInputWrapper::readSomeBytes( uno::Sequence< sal_Int8
void SAL_CALL OSeekableInputWrapper::skipBytes( sal_Int32 nBytesToSkip )
{
std::lock_guard aGuard( m_aMutex );
std::scoped_lock aGuard( m_aMutex );
if ( !m_xOriginalStream.is() )
throw io::NotConnectedException();
@@ -156,7 +156,7 @@ void SAL_CALL OSeekableInputWrapper::skipBytes( sal_Int32 nBytesToSkip )
sal_Int32 SAL_CALL OSeekableInputWrapper::available()
{
std::lock_guard aGuard( m_aMutex );
std::scoped_lock aGuard( m_aMutex );
if ( !m_xOriginalStream.is() )
throw io::NotConnectedException();
@@ -169,7 +169,7 @@ sal_Int32 SAL_CALL OSeekableInputWrapper::available()
void SAL_CALL OSeekableInputWrapper::closeInput()
{
std::lock_guard aGuard( m_aMutex );
std::scoped_lock aGuard( m_aMutex );
if ( !m_xOriginalStream.is() )
throw io::NotConnectedException();
@@ -191,7 +191,7 @@ void SAL_CALL OSeekableInputWrapper::closeInput()
void SAL_CALL OSeekableInputWrapper::seek( sal_Int64 location )
{
std::lock_guard aGuard( m_aMutex );
std::scoped_lock aGuard( m_aMutex );
if ( !m_xOriginalStream.is() )
throw io::NotConnectedException();
@@ -204,7 +204,7 @@ void SAL_CALL OSeekableInputWrapper::seek( sal_Int64 location )
sal_Int64 SAL_CALL OSeekableInputWrapper::getPosition()
{
std::lock_guard aGuard( m_aMutex );
std::scoped_lock aGuard( m_aMutex );
if ( !m_xOriginalStream.is() )
throw io::NotConnectedException();
@@ -217,7 +217,7 @@ sal_Int64 SAL_CALL OSeekableInputWrapper::getPosition()
sal_Int64 SAL_CALL OSeekableInputWrapper::getLength()
{
std::lock_guard aGuard( m_aMutex );
std::scoped_lock aGuard( m_aMutex );
if ( !m_xOriginalStream.is() )
throw io::NotConnectedException();
@@ -103,7 +103,7 @@ uno::Sequence< OUString > SAL_CALL SequenceInputStreamService::getSupportedServi
// css::io::XInputStream:
::sal_Int32 SAL_CALL SequenceInputStreamService::readBytes( uno::Sequence< ::sal_Int8 > & aData, ::sal_Int32 nBytesToRead )
{
std::lock_guard aGuard( m_aMutex );
std::scoped_lock aGuard( m_aMutex );
if ( !m_xInputStream.is() )
throw io::NotConnectedException();
@@ -112,7 +112,7 @@ uno::Sequence< OUString > SAL_CALL SequenceInputStreamService::getSupportedServi
::sal_Int32 SAL_CALL SequenceInputStreamService::readSomeBytes( uno::Sequence< ::sal_Int8 > & aData, ::sal_Int32 nMaxBytesToRead )
{
std::lock_guard aGuard( m_aMutex );
std::scoped_lock aGuard( m_aMutex );
if ( !m_xInputStream.is() )
throw io::NotConnectedException();
@@ -121,7 +121,7 @@ uno::Sequence< OUString > SAL_CALL SequenceInputStreamService::getSupportedServi
void SAL_CALL SequenceInputStreamService::skipBytes( ::sal_Int32 nBytesToSkip )
{
std::lock_guard aGuard( m_aMutex );
std::scoped_lock aGuard( m_aMutex );
if ( !m_xInputStream.is() )
throw io::NotConnectedException();
@@ -130,7 +130,7 @@ void SAL_CALL SequenceInputStreamService::skipBytes( ::sal_Int32 nBytesToSkip )
::sal_Int32 SAL_CALL SequenceInputStreamService::available()
{
std::lock_guard aGuard( m_aMutex );
std::scoped_lock aGuard( m_aMutex );
if ( !m_xInputStream.is() )
throw io::NotConnectedException();
@@ -139,7 +139,7 @@ void SAL_CALL SequenceInputStreamService::skipBytes( ::sal_Int32 nBytesToSkip )
void SAL_CALL SequenceInputStreamService::closeInput()
{
std::lock_guard aGuard( m_aMutex );
std::scoped_lock aGuard( m_aMutex );
if ( !m_xInputStream.is() )
throw io::NotConnectedException();
@@ -151,7 +151,7 @@ void SAL_CALL SequenceInputStreamService::closeInput()
// css::io::XSeekable:
void SAL_CALL SequenceInputStreamService::seek( ::sal_Int64 location )
{
std::lock_guard aGuard( m_aMutex );
std::scoped_lock aGuard( m_aMutex );
if ( !m_xSeekable.is() )
throw io::NotConnectedException();
@@ -160,7 +160,7 @@ void SAL_CALL SequenceInputStreamService::seek( ::sal_Int64 location )
::sal_Int64 SAL_CALL SequenceInputStreamService::getPosition()
{
std::lock_guard aGuard( m_aMutex );
std::scoped_lock aGuard( m_aMutex );
if ( !m_xSeekable.is() )
throw io::NotConnectedException();
@@ -169,7 +169,7 @@ void SAL_CALL SequenceInputStreamService::seek( ::sal_Int64 location )
::sal_Int64 SAL_CALL SequenceInputStreamService::getLength()
{
std::lock_guard aGuard( m_aMutex );
std::scoped_lock aGuard( m_aMutex );
if ( !m_xSeekable.is() )
throw io::NotConnectedException();
@@ -179,7 +179,7 @@ void SAL_CALL SequenceInputStreamService::seek( ::sal_Int64 location )
// css::lang::XInitialization:
void SAL_CALL SequenceInputStreamService::initialize( const uno::Sequence< css::uno::Any > & aArguments )
{
std::lock_guard aGuard( m_aMutex );
std::scoped_lock aGuard( m_aMutex );
if ( m_bInitialized )
throw frame::DoubleInitializationException();
@@ -90,7 +90,7 @@ uno::Sequence< OUString > SAL_CALL SequenceOutputStreamService::getSupportedServ
// css::io::XOutputStream:
void SAL_CALL SequenceOutputStreamService::writeBytes( const uno::Sequence< ::sal_Int8 > & aData )
{
std::lock_guard aGuard( m_aMutex );
std::scoped_lock aGuard( m_aMutex );
if ( !m_xOutputStream.is() )
throw io::NotConnectedException();
@@ -99,7 +99,7 @@ void SAL_CALL SequenceOutputStreamService::writeBytes( const uno::Sequence< ::sa
void SAL_CALL SequenceOutputStreamService::flush()
{
std::lock_guard aGuard( m_aMutex );
std::scoped_lock aGuard( m_aMutex );
if ( !m_xOutputStream.is() )
throw io::NotConnectedException();
@@ -108,7 +108,7 @@ void SAL_CALL SequenceOutputStreamService::flush()
void SAL_CALL SequenceOutputStreamService::closeOutput()
{
std::lock_guard aGuard( m_aMutex );
std::scoped_lock aGuard( m_aMutex );
if ( !m_xOutputStream.is() )
throw io::NotConnectedException();
@@ -119,7 +119,7 @@ void SAL_CALL SequenceOutputStreamService::closeOutput()
// css::io::XSequenceOutputStream:
uno::Sequence< ::sal_Int8 > SAL_CALL SequenceOutputStreamService::getWrittenBytes()
{
std::lock_guard aGuard( m_aMutex );
std::scoped_lock aGuard( m_aMutex );
if ( !m_xOutputStream.is() )
throw io::NotConnectedException();
+10 -10
View File
@@ -60,7 +60,7 @@ sal_Int32 SAL_CALL SequenceInputStream::readBytes( Sequence<sal_Int8>& aData, sa
if (nBytesToRead < 0)
throw BufferSizeExceededException(OUString(),*this);
std::lock_guard aGuard( m_aMutex );
std::scoped_lock aGuard( m_aMutex );
sal_Int32 nAvail = avail();
@@ -87,7 +87,7 @@ void SAL_CALL SequenceInputStream::skipBytes( sal_Int32 nBytesToSkip )
if (nBytesToSkip < 0)
throw BufferSizeExceededException(OUString(),*this);
std::lock_guard aGuard( m_aMutex );
std::scoped_lock aGuard( m_aMutex );
sal_Int32 nAvail = avail();
@@ -100,7 +100,7 @@ void SAL_CALL SequenceInputStream::skipBytes( sal_Int32 nBytesToSkip )
sal_Int32 SAL_CALL SequenceInputStream::available( )
{
std::lock_guard aGuard( m_aMutex );
std::scoped_lock aGuard( m_aMutex );
return avail();
}
@@ -108,7 +108,7 @@ sal_Int32 SAL_CALL SequenceInputStream::available( )
void SAL_CALL SequenceInputStream::closeInput( )
{
std::lock_guard aGuard( m_aMutex );
std::scoped_lock aGuard( m_aMutex );
if (m_nPos == -1)
throw NotConnectedException(OUString(), *this);
@@ -120,19 +120,19 @@ void SAL_CALL SequenceInputStream::seek( sal_Int64 location )
{
if ( location > m_aData.getLength() || location < 0 || location > SAL_MAX_INT32 )
throw IllegalArgumentException("bad location", static_cast<cppu::OWeakObject*>(this), 1);
std::lock_guard aGuard( m_aMutex );
std::scoped_lock aGuard( m_aMutex );
m_nPos = static_cast<sal_Int32>(location);
}
sal_Int64 SAL_CALL SequenceInputStream::getPosition()
{
std::lock_guard aGuard( m_aMutex );
std::scoped_lock aGuard( m_aMutex );
return m_nPos;
}
sal_Int64 SAL_CALL SequenceInputStream::getLength( )
{
std::lock_guard aGuard( m_aMutex );
std::scoped_lock aGuard( m_aMutex );
return m_aData.getLength();
}
@@ -153,7 +153,7 @@ OSequenceOutputStream::OSequenceOutputStream(Sequence< sal_Int8 >& _rSeq, double
void SAL_CALL OSequenceOutputStream::writeBytes( const Sequence< sal_Int8 >& _rData )
{
std::lock_guard aGuard(m_aMutex);
std::scoped_lock aGuard(m_aMutex);
if (!m_bConnected)
throw NotConnectedException();
@@ -193,7 +193,7 @@ void SAL_CALL OSequenceOutputStream::writeBytes( const Sequence< sal_Int8 >& _rD
void SAL_CALL OSequenceOutputStream::flush( )
{
std::lock_guard aGuard(m_aMutex);
std::scoped_lock aGuard(m_aMutex);
if (!m_bConnected)
throw NotConnectedException();
@@ -211,7 +211,7 @@ void OSequenceOutputStream::finalizeOutput()
void SAL_CALL OSequenceOutputStream::closeOutput()
{
std::lock_guard aGuard(m_aMutex);
std::scoped_lock aGuard(m_aMutex);
if (!m_bConnected)
throw NotConnectedException();
@@ -27,7 +27,7 @@ Check for unused classes where the compiler cannot decide (e.g. because of
non-trivial or extern ctors) if a variable is unused if only its ctor/dtor
are called and nothing else. For example std::vector is a class where
the ctor may call further functions, but an unused std::string variable
does nothing. On the other hand, std::lock_guard instances are used
does nothing. On the other hand, std::scoped_lock instances are used
for their dtors and so are not unused even if not otherwise accessed.
Classes which are safe to be warned about need to be marked using
+2 -2
View File
@@ -76,7 +76,7 @@ static void s_setCurrent(uno_Environment * pEnv)
{
oslThreadIdentifier threadId = osl::Thread::getCurrentIdentifier();
std::lock_guard guard(s_threadMap_mutex);
std::scoped_lock guard(s_threadMap_mutex);
if (pEnv)
{
s_threadMap[threadId] = pEnv;
@@ -95,7 +95,7 @@ static uno_Environment * s_getCurrent()
oslThreadIdentifier threadId = osl::Thread::getCurrentIdentifier();
std::lock_guard guard(s_threadMap_mutex);
std::scoped_lock guard(s_threadMap_mutex);
ThreadMap::iterator iEnv = s_threadMap.find(threadId);
if(iEnv != s_threadMap.end())
pEnv = iEnv->second;
+2 -2
View File
@@ -319,7 +319,7 @@ static OUString getBridgeName(
static void setNegativeBridge( const OUString & rBridgeName )
{
MappingsData & rData = getMappingsData();
std::lock_guard aGuard( rData.aNegativeLibsMutex );
std::scoped_lock aGuard( rData.aNegativeLibsMutex );
rData.aNegativeLibs.insert( rBridgeName );
}
@@ -356,7 +356,7 @@ static bool loadModule(osl::Module & rModule, const OUString & rBridgeName)
bool bNeg;
{
MappingsData & rData = getMappingsData();
std::lock_guard aGuard( rData.aNegativeLibsMutex );
std::scoped_lock aGuard( rData.aNegativeLibsMutex );
const auto iFind( rData.aNegativeLibs.find( rBridgeName ) );
bNeg = (iFind != rData.aNegativeLibs.end());
}
+1 -1
View File
@@ -68,7 +68,7 @@ static type_entry * getTypeEntries( class_data * cd )
if (! cd->m_storedTypeRefs) // not inited?
{
static std::mutex aMutex;
std::lock_guard guard( aMutex );
std::scoped_lock guard( aMutex );
if (! cd->m_storedTypeRefs) // not inited?
{
// get all types
+6 -6
View File
@@ -853,7 +853,7 @@ void PropertySetMixinImpl::prepareSet(
Impl::VetoListenerBag specificVeto;
Impl::VetoListenerBag unspecificVeto;
{
std::lock_guard g(m_impl->mutex);
std::scoped_lock g(m_impl->mutex);
if (m_impl->disposed) {
throw css::lang::DisposedException(
"disposed", static_cast< css::beans::XPropertySet * >(this));
@@ -922,7 +922,7 @@ void PropertySetMixinImpl::dispose() {
Impl::BoundListenerMap boundListeners;
Impl::VetoListenerMap vetoListeners;
{
std::lock_guard g(m_impl->mutex);
std::scoped_lock g(m_impl->mutex);
boundListeners.swap(m_impl->boundListeners);
vetoListeners.swap(m_impl->vetoListeners);
m_impl->disposed = true;
@@ -1001,7 +1001,7 @@ void PropertySetMixinImpl::addPropertyChangeListener(
checkUnknown(propertyName);
bool disposed;
{
std::lock_guard g(m_impl->mutex);
std::scoped_lock g(m_impl->mutex);
disposed = m_impl->disposed;
if (!disposed) {
m_impl->boundListeners[propertyName].insert(listener);
@@ -1020,7 +1020,7 @@ void PropertySetMixinImpl::removePropertyChangeListener(
{
assert(listener.is());
checkUnknown(propertyName);
std::lock_guard g(m_impl->mutex);
std::scoped_lock g(m_impl->mutex);
Impl::BoundListenerMap::iterator i(
m_impl->boundListeners.find(propertyName));
if (i != m_impl->boundListeners.end()) {
@@ -1040,7 +1040,7 @@ void PropertySetMixinImpl::addVetoableChangeListener(
checkUnknown(propertyName);
bool disposed;
{
std::lock_guard g(m_impl->mutex);
std::scoped_lock g(m_impl->mutex);
disposed = m_impl->disposed;
if (!disposed) {
m_impl->vetoListeners[propertyName].insert(listener);
@@ -1059,7 +1059,7 @@ void PropertySetMixinImpl::removeVetoableChangeListener(
{
assert(listener.is());
checkUnknown(propertyName);
std::lock_guard g(m_impl->mutex);
std::scoped_lock g(m_impl->mutex);
Impl::VetoListenerMap::iterator i(m_impl->vetoListeners.find(propertyName));
if (i != m_impl->vetoListeners.end()) {
Impl::VetoListenerBag::iterator j(i->second.find(listener));
+2 -2
View File
@@ -470,13 +470,13 @@ private:
sal_Bool ContentEnumeration::hasMoreElements()
{
std::lock_guard g(mutex_);
std::scoped_lock g(mutex_);
return iterator_ != factories_.end();
}
css::uno::Any ContentEnumeration::nextElement()
{
std::lock_guard g(mutex_);
std::scoped_lock g(mutex_);
if (iterator_ == factories_.end()) {
throw css::container::NoSuchElementException(
"Bootstrap service manager service enumerator has no more elements",
+1 -1
View File
@@ -1679,7 +1679,7 @@ Enumeration::nextTypeDescription()
{
OUString name;
{
std::lock_guard g(mutex_);
std::scoped_lock g(mutex_);
if (positions_.empty()) {
throw css::container::NoSuchElementException(
"exhausted XTypeDescriptionEnumeration",
+8 -8
View File
@@ -305,7 +305,7 @@ void SAL_CALL EventAttacherImpl::initialize(const Sequence< Any >& Arguments)
arg >>= xALAS;
if( xALAS.is() )
{
std::lock_guard aGuard( m_aMutex );
std::scoped_lock aGuard( m_aMutex );
m_xInvocationAdapterFactory = xALAS;
}
// Introspection service ?
@@ -313,7 +313,7 @@ void SAL_CALL EventAttacherImpl::initialize(const Sequence< Any >& Arguments)
arg >>= xI;
if( xI.is() )
{
std::lock_guard aGuard( m_aMutex );
std::scoped_lock aGuard( m_aMutex );
m_xIntrospection = xI;
}
// Reflection service ?
@@ -321,7 +321,7 @@ void SAL_CALL EventAttacherImpl::initialize(const Sequence< Any >& Arguments)
arg >>= xIdlR;
if( xIdlR.is() )
{
std::lock_guard aGuard( m_aMutex );
std::scoped_lock aGuard( m_aMutex );
m_xReflection = xIdlR;
}
// Converter Service ?
@@ -329,7 +329,7 @@ void SAL_CALL EventAttacherImpl::initialize(const Sequence< Any >& Arguments)
arg >>= xC;
if( xC.is() )
{
std::lock_guard aGuard( m_aMutex );
std::scoped_lock aGuard( m_aMutex );
m_xConverter = xC;
}
@@ -343,7 +343,7 @@ void SAL_CALL EventAttacherImpl::initialize(const Sequence< Any >& Arguments)
//*** Private helper methods ***
Reference< XIntrospection > EventAttacherImpl::getIntrospection()
{
std::lock_guard aGuard( m_aMutex );
std::scoped_lock aGuard( m_aMutex );
if( !m_xIntrospection.is() )
{
m_xIntrospection = theIntrospection::get( m_xContext );
@@ -355,7 +355,7 @@ Reference< XIntrospection > EventAttacherImpl::getIntrospection()
//*** Private helper methods ***
Reference< XIdlReflection > EventAttacherImpl::getReflection()
{
std::lock_guard aGuard( m_aMutex );
std::scoped_lock aGuard( m_aMutex );
if( !m_xReflection.is() )
{
m_xReflection = theCoreReflection::get(m_xContext);
@@ -367,7 +367,7 @@ Reference< XIdlReflection > EventAttacherImpl::getReflection()
//*** Private helper methods ***
Reference< XInvocationAdapterFactory2 > EventAttacherImpl::getInvocationAdapterService()
{
std::lock_guard aGuard( m_aMutex );
std::scoped_lock aGuard( m_aMutex );
if( !m_xInvocationAdapterFactory.is() )
{
m_xInvocationAdapterFactory = InvocationAdapterFactory::create(m_xContext);
@@ -379,7 +379,7 @@ Reference< XInvocationAdapterFactory2 > EventAttacherImpl::getInvocationAdapterS
//*** Private helper methods ***
Reference< XTypeConverter > EventAttacherImpl::getConverter()
{
std::lock_guard aGuard( m_aMutex );
std::scoped_lock aGuard( m_aMutex );
if( !m_xConverter.is() )
{
m_xConverter = Converter::create(m_xContext);
@@ -66,7 +66,7 @@ StatusIndicatorFactory::~StatusIndicatorFactory()
void SAL_CALL StatusIndicatorFactory::initialize(const css::uno::Sequence< css::uno::Any >& lArguments)
{
if (lArguments.hasElements()) {
std::lock_guard g(m_mutex);
std::scoped_lock g(m_mutex);
css::uno::Reference< css::frame::XFrame > xTmpFrame;
css::uno::Reference< css::awt::XWindow > xTmpWindow;
@@ -103,7 +103,7 @@ css::uno::Reference< css::task::XStatusIndicator > SAL_CALL StatusIndicatorFacto
void SAL_CALL StatusIndicatorFactory::update()
{
std::lock_guard g(m_mutex);
std::scoped_lock g(m_mutex);
m_bAllowReschedule = true;
}
@@ -114,7 +114,7 @@ void StatusIndicatorFactory::start(const css::uno::Reference< css::task::XStatus
css::uno::Reference< css::task::XStatusIndicator > xProgress;
// SAFE -> ----------------------------------
{
std::lock_guard aWriteLock(m_mutex);
std::scoped_lock aWriteLock(m_mutex);
// create new info structure for this child or move it to the front of our stack
IndicatorStack::iterator pItem = ::std::find(m_aStack.begin(), m_aStack.end(), xChild);
@@ -143,7 +143,7 @@ void StatusIndicatorFactory::reset(const css::uno::Reference< css::task::XStatus
css::uno::Reference< css::task::XStatusIndicator > xProgress;
// SAFE -> ----------------------------------
{
std::lock_guard aReadLock(m_mutex);
std::scoped_lock aReadLock(m_mutex);
// reset the internal info structure related to this child
IndicatorStack::iterator pItem = ::std::find(m_aStack.begin(), m_aStack.end(), xChild);
@@ -177,7 +177,7 @@ void StatusIndicatorFactory::end(const css::uno::Reference< css::task::XStatusIn
sal_Int32 nValue = 0;
// SAFE -> ----------------------------------
{
std::lock_guard aWriteLock(m_mutex);
std::scoped_lock aWriteLock(m_mutex);
// remove this child from our stack
IndicatorStack::iterator pItem = ::std::find(m_aStack.begin(), m_aStack.end(), xChild);
@@ -231,7 +231,7 @@ void StatusIndicatorFactory::setText(const css::uno::Reference< css::task::XStat
css::uno::Reference< css::task::XStatusIndicator > xProgress;
// SAFE -> ----------------------------------
{
std::lock_guard aWriteLock(m_mutex);
std::scoped_lock aWriteLock(m_mutex);
IndicatorStack::iterator pItem = ::std::find(m_aStack.begin(), m_aStack.end(), xChild);
if (pItem != m_aStack.end())
@@ -263,7 +263,7 @@ void StatusIndicatorFactory::setValue( const css::uno::Reference< css::task::XSt
css::uno::Reference< css::task::XStatusIndicator > xProgress;
// SAFE -> ----------------------------------
{
std::lock_guard aWriteLock(m_mutex);
std::scoped_lock aWriteLock(m_mutex);
IndicatorStack::iterator pItem = ::std::find(m_aStack.begin(), m_aStack.end(), xChild);
if (pItem != m_aStack.end())
@@ -296,7 +296,7 @@ void StatusIndicatorFactory::implts_makeParentVisibleIfAllowed()
css::uno::Reference< css::uno::XComponentContext > xContext;
// SAFE -> ----------------------------------
{
std::lock_guard aReadLock(m_mutex);
std::scoped_lock aReadLock(m_mutex);
if (!m_bAllowParentShow)
return;
@@ -390,7 +390,7 @@ void StatusIndicatorFactory::impl_createProgress()
css::uno::Reference< css::awt::XWindow > xWindow;
// SAFE -> ----------------------------------
{
std::lock_guard aReadLock(m_mutex);
std::scoped_lock aReadLock(m_mutex);
xFrame = m_xFrame;
xWindow = m_xPluggWindow;
@@ -427,7 +427,7 @@ void StatusIndicatorFactory::impl_createProgress()
}
}
std::lock_guard g(m_mutex);
std::scoped_lock g(m_mutex);
m_xProgress = xProgress;
}
@@ -436,7 +436,7 @@ void StatusIndicatorFactory::impl_showProgress()
css::uno::Reference< css::frame::XFrame > xFrame;
// SAFE -> ----------------------------------
{
std::lock_guard aReadLock(m_mutex);
std::scoped_lock aReadLock(m_mutex);
xFrame = m_xFrame;
}
@@ -468,7 +468,7 @@ void StatusIndicatorFactory::impl_showProgress()
}
}
std::lock_guard g(m_mutex);
std::scoped_lock g(m_mutex);
m_xProgress = xProgress;
}
@@ -477,7 +477,7 @@ void StatusIndicatorFactory::impl_hideProgress()
css::uno::Reference< css::frame::XFrame > xFrame;
// SAFE -> ----------------------------------
{
std::lock_guard aReadLock(m_mutex);
std::scoped_lock aReadLock(m_mutex);
xFrame = m_xFrame;
}
@@ -501,7 +501,7 @@ void StatusIndicatorFactory::impl_reschedule(bool bForce)
{
// SAFE ->
{
std::lock_guard aReadLock(m_mutex);
std::scoped_lock aReadLock(m_mutex);
if (m_bDisableReschedule)
return;
}
@@ -510,7 +510,7 @@ void StatusIndicatorFactory::impl_reschedule(bool bForce)
bool bReschedule = bForce;
if (!bReschedule)
{
std::lock_guard g(m_mutex);
std::scoped_lock g(m_mutex);
bReschedule = m_bAllowReschedule;
m_bAllowReschedule = false;
}
@@ -540,7 +540,7 @@ void StatusIndicatorFactory::impl_reschedule(bool bForce)
void StatusIndicatorFactory::impl_startWakeUpThread()
{
std::lock_guard g(m_mutex);
std::scoped_lock g(m_mutex);
if (m_bDisableReschedule)
return;
@@ -556,7 +556,7 @@ void StatusIndicatorFactory::impl_stopWakeUpThread()
{
rtl::Reference<WakeUpThread> wakeUp;
{
std::lock_guard g(m_mutex);
std::scoped_lock g(m_mutex);
std::swap(wakeUp, m_pWakeUp);
}
if (wakeUp.is())
+4 -4
View File
@@ -95,7 +95,7 @@ css::uno::Any SAL_CALL DispatchHelper::executeDispatch(
css::uno::Reference<css::util::XURLTransformer> xParser;
/* SAFE { */
{
std::lock_guard aReadLock(m_mutex);
std::scoped_lock aReadLock(m_mutex);
xParser = css::util::URLTransformer::create(m_xContext);
}
/* } SAFE */
@@ -150,7 +150,7 @@ DispatchHelper::executeDispatch(const css::uno::Reference<css::frame::XDispatch>
css::uno::UNO_QUERY);
/* SAFE { */
{
std::lock_guard aWriteLock(m_mutex);
std::scoped_lock aWriteLock(m_mutex);
m_xBroadcaster = xNotifyDispatch;
m_aBlockFlag = false;
}
@@ -184,7 +184,7 @@ DispatchHelper::executeDispatch(const css::uno::Reference<css::frame::XDispatch>
*/
void SAL_CALL DispatchHelper::dispatchFinished(const css::frame::DispatchResultEvent& aResult)
{
std::lock_guard g(m_mutex);
std::scoped_lock g(m_mutex);
m_aResult <<= aResult;
m_aBlockFlag = true;
m_aBlock.notify_one();
@@ -198,7 +198,7 @@ void SAL_CALL DispatchHelper::dispatchFinished(const css::frame::DispatchResultE
*/
void SAL_CALL DispatchHelper::disposing(const css::lang::EventObject&)
{
std::lock_guard g(m_mutex);
std::scoped_lock g(m_mutex);
m_aResult.clear();
m_aBlockFlag = true;
m_aBlock.notify_one();
@@ -554,7 +554,7 @@ struct Separators
Separators getLocaleSeparators(const Locale& rLocale, const OUString& rLocStr)
{
// Guard the static variable below.
std::lock_guard aGuard(theNatNumMutex);
std::scoped_lock aGuard(theNatNumMutex);
// Maximum a couple hundred of pairs with 4-byte structs - so no need for smart managing
static std::unordered_map<OUString, Separators> aLocaleSeparatorsBuf;
auto it = aLocaleSeparatorsBuf.find(rLocStr);
@@ -603,7 +603,7 @@ OUString getNumberText(const Locale& rLocale, const OUString& rNumberString,
= css::linguistic2::NumberText::create(comphelper::getProcessComponentContext());
// Guard the static variables below.
std::lock_guard aGuard( theNatNumMutex );
std::scoped_lock aGuard( theNatNumMutex );
OUString numbertext_prefix;
// default "cardinal" gets empty prefix
@@ -43,7 +43,7 @@ NumberFormatCodeMapper::getDefault( sal_Int16 formatType, sal_Int16 formatUsage,
OUString elementType = mapElementTypeShortToString(formatType);
OUString elementUsage = mapElementUsageShortToString(formatUsage);
std::lock_guard g(maMutex);
std::scoped_lock g(maMutex);
const css::uno::Sequence< css::i18n::FormatElement > &aFormatSeq = getFormats( rLocale );
auto pFormat = std::find_if(aFormatSeq.begin(), aFormatSeq.end(),
@@ -67,7 +67,7 @@ NumberFormatCodeMapper::getDefault( sal_Int16 formatType, sal_Int16 formatUsage,
css::i18n::NumberFormatCode SAL_CALL
NumberFormatCodeMapper::getFormatCode( sal_Int16 formatIndex, const css::lang::Locale& rLocale )
{
std::lock_guard g(maMutex);
std::scoped_lock g(maMutex);
const css::uno::Sequence< css::i18n::FormatElement > &aFormatSeq = getFormats( rLocale );
auto pFormat = std::find_if(aFormatSeq.begin(), aFormatSeq.end(),
@@ -88,7 +88,7 @@ NumberFormatCodeMapper::getFormatCode( sal_Int16 formatIndex, const css::lang::L
css::uno::Sequence< css::i18n::NumberFormatCode > SAL_CALL
NumberFormatCodeMapper::getAllFormatCode( sal_Int16 formatUsage, const css::lang::Locale& rLocale )
{
std::lock_guard g(maMutex);
std::scoped_lock g(maMutex);
const css::uno::Sequence< css::i18n::FormatElement > &aFormatSeq = getFormats( rLocale );
std::vector<css::i18n::NumberFormatCode> aVec;
@@ -113,7 +113,7 @@ NumberFormatCodeMapper::getAllFormatCode( sal_Int16 formatUsage, const css::lang
css::uno::Sequence< css::i18n::NumberFormatCode > SAL_CALL
NumberFormatCodeMapper::getAllFormatCodes( const css::lang::Locale& rLocale )
{
std::lock_guard g(maMutex);
std::scoped_lock g(maMutex);
const css::uno::Sequence< css::i18n::FormatElement > &aFormatSeq = getFormats( rLocale );
std::vector<css::i18n::NumberFormatCode> aVec;
@@ -161,7 +161,7 @@ Locale SAL_CALL LangGuess_Impl::guessPrimaryLanguage(
::sal_Int32 nStartPos,
::sal_Int32 nLen )
{
std::lock_guard aGuard( GetLangGuessMutex() );
std::scoped_lock aGuard( GetLangGuessMutex() );
EnsureInitialized();
@@ -190,7 +190,7 @@ void LangGuess_Impl::SetFingerPrintsDB(
uno::Sequence< Locale > SAL_CALL LangGuess_Impl::getAvailableLanguages( )
{
std::lock_guard aGuard( GetLangGuessMutex() );
std::scoped_lock aGuard( GetLangGuessMutex() );
EnsureInitialized();
@@ -212,7 +212,7 @@ uno::Sequence< Locale > SAL_CALL LangGuess_Impl::getAvailableLanguages( )
uno::Sequence< Locale > SAL_CALL LangGuess_Impl::getEnabledLanguages( )
{
std::lock_guard aGuard( GetLangGuessMutex() );
std::scoped_lock aGuard( GetLangGuessMutex() );
EnsureInitialized();
@@ -234,7 +234,7 @@ uno::Sequence< Locale > SAL_CALL LangGuess_Impl::getEnabledLanguages( )
uno::Sequence< Locale > SAL_CALL LangGuess_Impl::getDisabledLanguages( )
{
std::lock_guard aGuard( GetLangGuessMutex() );
std::scoped_lock aGuard( GetLangGuessMutex() );
EnsureInitialized();
@@ -257,7 +257,7 @@ uno::Sequence< Locale > SAL_CALL LangGuess_Impl::getDisabledLanguages( )
void SAL_CALL LangGuess_Impl::disableLanguages(
const uno::Sequence< Locale >& rLanguages )
{
std::lock_guard aGuard( GetLangGuessMutex() );
std::scoped_lock aGuard( GetLangGuessMutex() );
EnsureInitialized();
@@ -278,7 +278,7 @@ void SAL_CALL LangGuess_Impl::disableLanguages(
void SAL_CALL LangGuess_Impl::enableLanguages(
const uno::Sequence< Locale >& rLanguages )
{
std::lock_guard aGuard( GetLangGuessMutex() );
std::scoped_lock aGuard( GetLangGuessMutex() );
EnsureInitialized();
@@ -112,7 +112,7 @@ void NumberText_Impl::EnsureInitialized()
OUString SAL_CALL NumberText_Impl::getNumberText(const OUString& rText, const Locale& rLocale)
{
std::lock_guard aGuard(GetNumberTextMutex());
std::scoped_lock aGuard(GetNumberTextMutex());
EnsureInitialized();
// libnumbertext supports Language + Country tags (separated by "_" or "-")
LanguageTag aLanguageTag(rLocale);
@@ -142,7 +142,7 @@ OUString SAL_CALL NumberText_Impl::getNumberText(const OUString& rText, const Lo
uno::Sequence<Locale> SAL_CALL NumberText_Impl::getAvailableLanguages()
{
std::lock_guard aGuard(GetNumberTextMutex());
std::scoped_lock aGuard(GetNumberTextMutex());
// TODO
Sequence<css::lang::Locale> aRes;
return aRes;
+2 -2
View File
@@ -576,7 +576,7 @@ static std::mutex s_GetCharClassMutex;
bool IsUpper( const OUString &rText, sal_Int32 nPos, sal_Int32 nLen, LanguageType nLanguage )
{
std::lock_guard aGuard( s_GetCharClassMutex );
std::scoped_lock aGuard( s_GetCharClassMutex );
CharClass &rCC = lcl_GetCharClass();
rCC.setLanguageTag( LanguageTag( nLanguage ));
@@ -612,7 +612,7 @@ CapType capitalType(const OUString& aTerm, CharClass const * pCC)
OUString ToLower( const OUString &rText, LanguageType nLanguage )
{
std::lock_guard aGuard( s_GetCharClassMutex );
std::scoped_lock aGuard( s_GetCharClassMutex );
CharClass &rCC = lcl_GetCharClass();
rCC.setLanguageTag( LanguageTag( nLanguage ));
+2 -2
View File
@@ -93,7 +93,7 @@ private:
DocumentOpenedGuard::DocumentOpenedGuard( const OUString& rUrl )
{
UrlPool& rUrlPool = StaticUrlPool::get();
std::lock_guard aGuard( rUrlPool.maMutex );
std::scoped_lock aGuard( rUrlPool.maMutex );
mbValid = rUrl.isEmpty() || (rUrlPool.maUrls.count( rUrl ) == 0);
if( mbValid && !rUrl.isEmpty() )
{
@@ -105,7 +105,7 @@ DocumentOpenedGuard::DocumentOpenedGuard( const OUString& rUrl )
DocumentOpenedGuard::~DocumentOpenedGuard()
{
UrlPool& rUrlPool = StaticUrlPool::get();
std::lock_guard aGuard( rUrlPool.maMutex );
std::scoped_lock aGuard( rUrlPool.maMutex );
if( !maUrl.isEmpty() )
rUrlPool.maUrls.erase( maUrl );
}
+1 -1
View File
@@ -125,7 +125,7 @@ Reference< XPropertySetInfo > SAL_CALL GenericPropertySet::getPropertySetInfo()
void SAL_CALL GenericPropertySet::setPropertyValue( const OUString& rPropertyName, const Any& rValue )
{
std::lock_guard aGuard( mMutex );
std::scoped_lock aGuard( mMutex );
maPropMap[ rPropertyName ] = rValue;
}
+2 -2
View File
@@ -31,13 +31,13 @@ OChildDispListener_Impl::~OChildDispListener_Impl()
void OChildDispListener_Impl::OwnerIsDisposed()
{
std::lock_guard aGuard( m_aMutex );
std::scoped_lock aGuard( m_aMutex );
m_pStorage = nullptr;
}
void SAL_CALL OChildDispListener_Impl::disposing( const lang::EventObject& Source )
{
std::lock_guard aGuard( m_aMutex );
std::scoped_lock aGuard( m_aMutex );
// ObjectIsDisposed must not contain any locking!
if ( m_pStorage && Source.Source.is() )
m_pStorage->ChildIsDisposed( Source.Source );
@@ -200,7 +200,7 @@ void SwitchablePersistenceStream::CloseAll_Impl()
// css::io::XStream
uno::Reference< io::XInputStream > SAL_CALL SwitchablePersistenceStream::getInputStream( )
{
std::lock_guard aGuard( m_aMutex );
std::scoped_lock aGuard( m_aMutex );
if ( m_pStreamData )
m_pStreamData->m_bInOpen = true;
@@ -209,7 +209,7 @@ uno::Reference< io::XInputStream > SAL_CALL SwitchablePersistenceStream::getInpu
uno::Reference< io::XOutputStream > SAL_CALL SwitchablePersistenceStream::getOutputStream( )
{
std::lock_guard aGuard( m_aMutex );
std::scoped_lock aGuard( m_aMutex );
if ( m_pStreamData )
m_pStreamData->m_bOutOpen = true;
@@ -219,7 +219,7 @@ uno::Reference< io::XOutputStream > SAL_CALL SwitchablePersistenceStream::getOut
// css::io::XInputStream
::sal_Int32 SAL_CALL SwitchablePersistenceStream::readBytes( uno::Sequence< ::sal_Int8 >& aData, ::sal_Int32 nBytesToRead )
{
std::lock_guard aGuard( m_aMutex );
std::scoped_lock aGuard( m_aMutex );
if ( !m_pStreamData )
throw io::NotConnectedException();
@@ -233,7 +233,7 @@ uno::Reference< io::XOutputStream > SAL_CALL SwitchablePersistenceStream::getOut
::sal_Int32 SAL_CALL SwitchablePersistenceStream::readSomeBytes( uno::Sequence< ::sal_Int8 >& aData, ::sal_Int32 nMaxBytesToRead )
{
std::lock_guard aGuard( m_aMutex );
std::scoped_lock aGuard( m_aMutex );
if ( !m_pStreamData )
throw io::NotConnectedException();
@@ -247,7 +247,7 @@ uno::Reference< io::XOutputStream > SAL_CALL SwitchablePersistenceStream::getOut
void SAL_CALL SwitchablePersistenceStream::skipBytes( ::sal_Int32 nBytesToSkip )
{
std::lock_guard aGuard( m_aMutex );
std::scoped_lock aGuard( m_aMutex );
if ( !m_pStreamData )
throw io::NotConnectedException();
@@ -261,7 +261,7 @@ void SAL_CALL SwitchablePersistenceStream::skipBytes( ::sal_Int32 nBytesToSkip )
::sal_Int32 SAL_CALL SwitchablePersistenceStream::available( )
{
std::lock_guard aGuard( m_aMutex );
std::scoped_lock aGuard( m_aMutex );
if ( !m_pStreamData )
throw io::NotConnectedException();
@@ -275,7 +275,7 @@ void SAL_CALL SwitchablePersistenceStream::skipBytes( ::sal_Int32 nBytesToSkip )
void SAL_CALL SwitchablePersistenceStream::closeInput()
{
std::lock_guard aGuard( m_aMutex );
std::scoped_lock aGuard( m_aMutex );
if ( !m_pStreamData )
throw io::NotConnectedException();
@@ -288,7 +288,7 @@ void SAL_CALL SwitchablePersistenceStream::closeInput()
// css::io::XOutputStream
void SAL_CALL SwitchablePersistenceStream::writeBytes( const uno::Sequence< ::sal_Int8 >& aData )
{
std::lock_guard aGuard( m_aMutex );
std::scoped_lock aGuard( m_aMutex );
if ( !m_pStreamData )
throw io::NotConnectedException();
@@ -305,7 +305,7 @@ void SAL_CALL SwitchablePersistenceStream::writeBytes( const uno::Sequence< ::sa
void SAL_CALL SwitchablePersistenceStream::flush( )
{
std::lock_guard aGuard( m_aMutex );
std::scoped_lock aGuard( m_aMutex );
if ( !m_pStreamData || m_pStreamData->m_bInStreamBased )
{
@@ -325,7 +325,7 @@ void SAL_CALL SwitchablePersistenceStream::flush( )
void SAL_CALL SwitchablePersistenceStream::closeOutput( )
{
std::lock_guard aGuard( m_aMutex );
std::scoped_lock aGuard( m_aMutex );
if ( !m_pStreamData )
throw io::NotConnectedException();
@@ -338,7 +338,7 @@ void SAL_CALL SwitchablePersistenceStream::closeOutput( )
// css::io::XTruncate
void SAL_CALL SwitchablePersistenceStream::truncate( )
{
std::lock_guard aGuard( m_aMutex );
std::scoped_lock aGuard( m_aMutex );
if ( !m_pStreamData )
throw io::NotConnectedException();
@@ -356,7 +356,7 @@ void SAL_CALL SwitchablePersistenceStream::truncate( )
// css::io::XSeekable
void SAL_CALL SwitchablePersistenceStream::seek( ::sal_Int64 location )
{
std::lock_guard aGuard( m_aMutex );
std::scoped_lock aGuard( m_aMutex );
if ( !m_pStreamData )
throw io::NotConnectedException();
@@ -370,7 +370,7 @@ void SAL_CALL SwitchablePersistenceStream::seek( ::sal_Int64 location )
::sal_Int64 SAL_CALL SwitchablePersistenceStream::getPosition( )
{
std::lock_guard aGuard( m_aMutex );
std::scoped_lock aGuard( m_aMutex );
if ( !m_pStreamData )
throw io::NotConnectedException();
@@ -384,7 +384,7 @@ void SAL_CALL SwitchablePersistenceStream::seek( ::sal_Int64 location )
::sal_Int64 SAL_CALL SwitchablePersistenceStream::getLength( )
{
std::lock_guard aGuard( m_aMutex );
std::scoped_lock aGuard( m_aMutex );
if ( !m_pStreamData )
throw io::NotConnectedException();
+7 -7
View File
@@ -48,7 +48,7 @@ ByteGrabber::~ByteGrabber()
void ByteGrabber::setInputStream (const uno::Reference < io::XInputStream >& xNewStream)
{
std::lock_guard aGuard( m_aMutex );
std::scoped_lock aGuard( m_aMutex );
xStream = xNewStream;
xSeek.set(xNewStream, uno::UNO_QUERY);
}
@@ -57,14 +57,14 @@ void ByteGrabber::setInputStream (const uno::Reference < io::XInputStream >& xNe
sal_Int32 ByteGrabber::readBytes( uno::Sequence< sal_Int8 >& aData,
sal_Int32 nBytesToRead )
{
std::lock_guard aGuard( m_aMutex );
std::scoped_lock aGuard( m_aMutex );
return xStream->readBytes(aData, nBytesToRead );
}
// XSeekable chained...
void ByteGrabber::seek( sal_Int64 location )
{
std::lock_guard aGuard( m_aMutex );
std::scoped_lock aGuard( m_aMutex );
if (!xSeek.is() )
throw io::IOException(THROW_WHERE );
@@ -76,7 +76,7 @@ void ByteGrabber::seek( sal_Int64 location )
sal_Int64 ByteGrabber::getPosition( )
{
std::lock_guard aGuard( m_aMutex );
std::scoped_lock aGuard( m_aMutex );
if (!xSeek.is() )
throw io::IOException(THROW_WHERE );
@@ -85,7 +85,7 @@ sal_Int64 ByteGrabber::getPosition( )
sal_Int64 ByteGrabber::getLength( )
{
std::lock_guard aGuard( m_aMutex );
std::scoped_lock aGuard( m_aMutex );
if (!xSeek.is() )
throw io::IOException(THROW_WHERE );
@@ -94,7 +94,7 @@ sal_Int64 ByteGrabber::getLength( )
sal_uInt16 ByteGrabber::ReadUInt16()
{
std::lock_guard aGuard( m_aMutex );
std::scoped_lock aGuard( m_aMutex );
if (xStream->readBytes(aSequence, 2) != 2)
return 0;
@@ -107,7 +107,7 @@ sal_uInt16 ByteGrabber::ReadUInt16()
sal_uInt32 ByteGrabber::ReadUInt32()
{
std::lock_guard aGuard( m_aMutex );
std::scoped_lock aGuard( m_aMutex );
if (xStream->readBytes(aSequence, 4) != 4)
return 0;
+2 -2
View File
@@ -62,7 +62,7 @@ BlowfishCFB8CipherContext::~BlowfishCFB8CipherContext()
uno::Sequence< sal_Int8 > SAL_CALL BlowfishCFB8CipherContext::convertWithCipherContext( const uno::Sequence< ::sal_Int8 >& aData )
{
std::lock_guard aGuard( m_aMutex );
std::scoped_lock aGuard( m_aMutex );
if ( !m_pCipher )
throw lang::DisposedException();
@@ -96,7 +96,7 @@ uno::Sequence< sal_Int8 > SAL_CALL BlowfishCFB8CipherContext::convertWithCipherC
uno::Sequence< ::sal_Int8 > SAL_CALL BlowfishCFB8CipherContext::finalizeCipherContextAndDispose()
{
std::lock_guard aGuard( m_aMutex );
std::scoped_lock aGuard( m_aMutex );
if ( !m_pCipher )
throw lang::DisposedException();
+4 -4
View File
@@ -49,7 +49,7 @@ StarOfficeSHA1DigestContext::~StarOfficeSHA1DigestContext()
void SAL_CALL StarOfficeSHA1DigestContext::updateDigest(const uno::Sequence<::sal_Int8>& aData)
{
std::lock_guard aGuard( m_aMutex );
std::scoped_lock aGuard( m_aMutex );
if ( !m_pDigest )
throw lang::DisposedException();
@@ -64,7 +64,7 @@ void SAL_CALL StarOfficeSHA1DigestContext::updateDigest(const uno::Sequence<::sa
uno::Sequence<::sal_Int8> SAL_CALL StarOfficeSHA1DigestContext::finalizeDigestAndDispose()
{
std::lock_guard aGuard( m_aMutex );
std::scoped_lock aGuard( m_aMutex );
if ( !m_pDigest )
throw lang::DisposedException();
@@ -98,7 +98,7 @@ CorrectSHA1DigestContext::~CorrectSHA1DigestContext()
void SAL_CALL CorrectSHA1DigestContext::updateDigest(const uno::Sequence<::sal_Int8>& rData)
{
std::lock_guard aGuard(m_Mutex);
std::scoped_lock aGuard(m_Mutex);
if (m_bDisposed)
throw lang::DisposedException();
@@ -107,7 +107,7 @@ void SAL_CALL CorrectSHA1DigestContext::updateDigest(const uno::Sequence<::sal_I
uno::Sequence<::sal_Int8> SAL_CALL CorrectSHA1DigestContext::finalizeDigestAndDispose()
{
std::lock_guard aGuard(m_Mutex);
std::scoped_lock aGuard(m_Mutex);
if (m_bDisposed)
throw lang::DisposedException();
+3 -3
View File
@@ -601,7 +601,7 @@ void Entity::throwException( const ::rtl::Reference< FastLocatorImpl > &xDocumen
// Error during parsing !
Any savedException;
{
std::lock_guard g(maSavedExceptionMutex);
std::scoped_lock g(maSavedExceptionMutex);
if (maSavedException.hasValue())
{
savedException.setValue(&maSavedException, cppu::UnoType<decltype(maSavedException)>::get());
@@ -643,7 +643,7 @@ void Entity::saveException( const Any & e )
// unexpectedly some 'startElements' produce a UNO_QUERY_THROW
// for XComponent; and yet expect to continue parsing.
SAL_WARN("sax", "Unexpected exception from XML parser " << exceptionToString(e));
std::lock_guard g(maSavedExceptionMutex);
std::scoped_lock g(maSavedExceptionMutex);
if (maSavedException.hasValue())
{
SAL_INFO("sax.fastparser", "discarding exception, already have one");
@@ -656,7 +656,7 @@ void Entity::saveException( const Any & e )
bool Entity::hasException()
{
std::lock_guard g(maSavedExceptionMutex);
std::scoped_lock g(maSavedExceptionMutex);
return maSavedException.hasValue();
}
+2 -2
View File
@@ -55,7 +55,7 @@ ColumnBlockPositionSet::ColumnBlockPositionSet(ScDocument& rDoc) : mrDoc(rDoc) {
ColumnBlockPosition* ColumnBlockPositionSet::getBlockPosition(SCTAB nTab, SCCOL nCol)
{
std::lock_guard aGuard(maMtxTables);
std::scoped_lock aGuard(maMtxTables);
TablesType::iterator itTab = maTables.find(nTab);
if (itTab == maTables.end())
@@ -93,7 +93,7 @@ ColumnBlockPosition* ColumnBlockPositionSet::getBlockPosition(SCTAB nTab, SCCOL
void ColumnBlockPositionSet::clear()
{
std::lock_guard aGuard(maMtxTables);
std::scoped_lock aGuard(maMtxTables);
maTables.clear();
}
+1 -1
View File
@@ -91,7 +91,7 @@ std::unique_ptr<SvNumberFormatter> ScPoolHelper::CreateNumberFormatter() const
{
std::unique_ptr<SvNumberFormatter> p;
{
std::lock_guard aGuard(maMtxCreateNumFormatter);
std::scoped_lock aGuard(maMtxCreateNumFormatter);
p.reset(new SvNumberFormatter(comphelper::getProcessComponentContext(), LANGUAGE_SYSTEM));
}
p->SetColorLink( LINK(&m_rSourceDoc, ScDocument, GetUserDefinedColor) );
+1 -1
View File
@@ -115,7 +115,7 @@ OUString ScEditUtil::GetString( const EditTextObject& rEditText, const ScDocumen
return GetMultilineString( rEditText );
static std::mutex aMutex;
std::lock_guard aGuard( aMutex);
std::scoped_lock aGuard( aMutex);
// ScFieldEditEngine is needed to resolve field contents.
if (pDoc)
{
+2 -2
View File
@@ -36,7 +36,7 @@ ScRefreshTimerProtector::ScRefreshTimerProtector( std::unique_ptr<ScRefreshTimer
{
m_rpControl->SetAllowRefresh( false );
// wait for any running refresh in another thread to finish
std::lock_guard aGuard( m_rpControl->GetMutex() );
std::scoped_lock aGuard( m_rpControl->GetMutex() );
}
}
@@ -122,7 +122,7 @@ void ScRefreshTimer::Invoke()
if ( ppControl && *ppControl && (*ppControl)->IsRefreshAllowed() )
{
// now we COULD make the call in another thread ...
std::lock_guard aGuard( (*ppControl)->GetMutex() );
std::scoped_lock aGuard( (*ppControl)->GetMutex() );
Timer::Invoke();
// restart from now on, don't execute immediately again if timed out
// a second time during refresh
+1 -1
View File
@@ -398,7 +398,7 @@ void FormulaBuffer::finalizeImport()
FormulaBuffer::SheetItem FormulaBuffer::getSheetItem( SCTAB nTab )
{
std::lock_guard aGuard(maMtxData);
std::scoped_lock aGuard(maMtxData);
SheetItem aItem;
@@ -335,7 +335,7 @@ MasterScriptProvider::providerCache()
{
if ( !m_pPCache )
{
std::lock_guard aGuard( m_mutex );
std::scoped_lock aGuard( m_mutex );
if ( !m_pPCache )
{
Sequence<OUString> denylist { "com.sun.star.script.provider.ScriptProviderForBasic" };
+3 -3
View File
@@ -62,7 +62,7 @@ ProviderCache::~ProviderCache()
Reference< provider::XScriptProvider >
ProviderCache::getProvider( const OUString& providerName )
{
std::lock_guard aGuard( m_mutex );
std::scoped_lock aGuard( m_mutex );
Reference< provider::XScriptProvider > provider;
ProviderDetails_hash::iterator h_it = m_hProviderDetailsCache.find( providerName );
if ( h_it != m_hProviderDetailsCache.end() )
@@ -86,7 +86,7 @@ ProviderCache::getAllProviders()
// need to create providers that haven't been created already
// so check what providers exist and what ones don't
std::lock_guard aGuard( m_mutex );
std::scoped_lock aGuard( m_mutex );
Sequence < Reference< provider::XScriptProvider > > providers ( m_hProviderDetailsCache.size() );
// should assert if size !> 0
if ( !m_hProviderDetailsCache.empty() )
@@ -132,7 +132,7 @@ ProviderCache::populateCache()
{
// wrong name in services.rdb
OUString serviceName;
std::lock_guard aGuard( m_mutex );
std::scoped_lock aGuard( m_mutex );
try
{
Reference< container::XContentEnumerationAccess > xEnumAccess( m_xMgr, UNO_QUERY_THROW );
@@ -73,7 +73,7 @@ void ResourceFactoryManager::AddFactory (
if (rsURL.isEmpty())
throw lang::IllegalArgumentException();
std::lock_guard aGuard (maMutex);
std::scoped_lock aGuard (maMutex);
if (rsURL.indexOf('*') >= 0 || rsURL.indexOf('?') >= 0)
{
@@ -100,7 +100,7 @@ void ResourceFactoryManager::RemoveFactoryForURL (
if (rsURL.isEmpty())
throw lang::IllegalArgumentException();
std::lock_guard aGuard (maMutex);
std::scoped_lock aGuard (maMutex);
FactoryMap::iterator iFactory (maFactoryMap.find(rsURL));
if (iFactory != maFactoryMap.end())
@@ -123,7 +123,7 @@ void ResourceFactoryManager::RemoveFactoryForURL (
void ResourceFactoryManager::RemoveFactoryForReference(
const Reference<XResourceFactory>& rxFactory)
{
std::lock_guard aGuard (maMutex);
std::scoped_lock aGuard (maMutex);
// Collect a list with all keys that map to the given factory.
::std::vector<OUString> aKeys;
@@ -178,7 +178,7 @@ Reference<XResourceFactory> ResourceFactoryManager::GetFactory (
Reference<XResourceFactory> ResourceFactoryManager::FindFactory (const OUString& rsURLBase)
{
std::lock_guard aGuard (maMutex);
std::scoped_lock aGuard (maMutex);
FactoryMap::const_iterator iFactory (maFactoryMap.find(rsURLBase));
if (iFactory != maFactoryMap.end())
return iFactory->second;
+1 -1
View File
@@ -145,7 +145,7 @@ void QueueProcessor::ProcessOneRequest (
{
try
{
std::lock_guard aGuard (maMutex);
std::scoped_lock aGuard (maMutex);
// Create a new preview bitmap and store it in the cache.
if (mpCache != nullptr && mpCacheContext)
+1 -1
View File
@@ -167,7 +167,7 @@ PPPOptimizerTokenEnum TKGet( const OUString& rToken )
{
if ( !pHashMap )
{ // init hash map
std::lock_guard aGuard( getHashMapMutex() );
std::scoped_lock aGuard( getHashMapMutex() );
if ( !pHashMap )
{
TypeNameHashMap* pH = new TypeNameHashMap;
+10 -10
View File
@@ -184,7 +184,7 @@ sal_Int32 TimerScheduler::mnTaskId = PresenterTimer::NotAValidTaskId;
std::shared_ptr<TimerScheduler> TimerScheduler::Instance(
uno::Reference<uno::XComponentContext> const& xContext)
{
std::lock_guard aGuard (maInstanceMutex);
std::scoped_lock aGuard (maInstanceMutex);
if (mpInstance == nullptr)
{
if (!xContext.is())
@@ -226,7 +226,7 @@ void TimerScheduler::ScheduleTask (const SharedTimerTask& rpTask)
return;
{
std::lock_guard aTaskGuard (maTaskContainerMutex);
std::scoped_lock aTaskGuard (maTaskContainerMutex);
maScheduledTasks.insert(rpTask);
}
}
@@ -237,7 +237,7 @@ void TimerScheduler::CancelTask (const sal_Int32 nTaskId)
// task ids. Therefore we have to do a linear search for the task to
// cancel.
{
std::lock_guard aGuard (maTaskContainerMutex);
std::scoped_lock aGuard (maTaskContainerMutex);
auto iTask = std::find_if(maScheduledTasks.begin(), maScheduledTasks.end(),
[nTaskId](const SharedTimerTask& rxTask) { return rxTask->mnTaskId == nTaskId; });
if (iTask != maScheduledTasks.end())
@@ -248,7 +248,7 @@ void TimerScheduler::CancelTask (const sal_Int32 nTaskId)
// processed. Mark it with a flag that a) prevents a repeating task
// from being scheduled again and b) tries to prevent its execution.
{
std::lock_guard aGuard (maCurrentTaskMutex);
std::scoped_lock aGuard (maCurrentTaskMutex);
if (mpCurrentTask
&& mpCurrentTask->mnTaskId == nTaskId)
mpCurrentTask->mbIsCanceled = true;
@@ -266,12 +266,12 @@ void TimerScheduler::NotifyTermination()
}
{
std::lock_guard aGuard(pInstance->maTaskContainerMutex);
std::scoped_lock aGuard(pInstance->maTaskContainerMutex);
pInstance->maScheduledTasks.clear();
}
{
std::lock_guard aGuard(pInstance->maCurrentTaskMutex);
std::scoped_lock aGuard(pInstance->maCurrentTaskMutex);
if (pInstance->mpCurrentTask)
{
pInstance->mpCurrentTask->mbIsCanceled = true;
@@ -303,7 +303,7 @@ void SAL_CALL TimerScheduler::run()
SharedTimerTask pTask;
sal_Int64 nDifference = 0;
{
std::lock_guard aGuard (maTaskContainerMutex);
std::scoped_lock aGuard (maTaskContainerMutex);
// There are no more scheduled task. Leave this loop, function and
// live of the TimerScheduler.
@@ -322,7 +322,7 @@ void SAL_CALL TimerScheduler::run()
// Acquire a reference to the current task.
{
std::lock_guard aGuard (maCurrentTaskMutex);
std::scoped_lock aGuard (maCurrentTaskMutex);
mpCurrentTask = pTask;
}
@@ -356,13 +356,13 @@ void SAL_CALL TimerScheduler::run()
// Release reference to the current task.
{
std::lock_guard aGuard (maCurrentTaskMutex);
std::scoped_lock aGuard (maCurrentTaskMutex);
mpCurrentTask.reset();
}
}
// While holding maInstanceMutex
std::lock_guard aInstance( maInstanceMutex );
std::scoped_lock aInstance( maInstanceMutex );
mpLateDestroy = mpInstance;
mpInstance.reset();
}
+3 -3
View File
@@ -517,7 +517,7 @@ ThumbnailViewItemAcc::~ThumbnailViewItemAcc()
void ThumbnailViewItemAcc::ParentDestroyed()
{
std::lock_guard aGuard( maMutex );
std::scoped_lock aGuard( maMutex );
mpParent = nullptr;
}
@@ -731,7 +731,7 @@ lang::Locale SAL_CALL ThumbnailViewItemAcc::getLocale()
void SAL_CALL ThumbnailViewItemAcc::addAccessibleEventListener( const uno::Reference< accessibility::XAccessibleEventListener >& rxListener )
{
std::lock_guard aGuard( maMutex );
std::scoped_lock aGuard( maMutex );
if( !rxListener.is() )
return;
@@ -753,7 +753,7 @@ void SAL_CALL ThumbnailViewItemAcc::addAccessibleEventListener( const uno::Refer
void SAL_CALL ThumbnailViewItemAcc::removeAccessibleEventListener( const uno::Reference< accessibility::XAccessibleEventListener >& rxListener )
{
std::lock_guard aGuard( maMutex );
std::scoped_lock aGuard( maMutex );
if( rxListener.is() )
{
+1 -1
View File
@@ -2670,7 +2670,7 @@ void SfxURLRelocator_Impl::initOfficeInstDirs()
{
if ( !mxOfficeInstDirs.is() )
{
std::lock_guard aGuard( maMutex );
std::scoped_lock aGuard( maMutex );
if ( !mxOfficeInstDirs.is() )
{
OSL_ENSURE( mxContext.is(), "No service manager!" );
+8 -8
View File
@@ -77,7 +77,7 @@ namespace slideshow::internal
bool EventQueue::addEvent( const EventSharedPtr& rEvent )
{
std::lock_guard aGuard( maMutex );
std::scoped_lock aGuard( maMutex );
SAL_INFO("slideshow.eventqueue", "adding event \"" << rEvent->GetDescription()
<< "\" [" << rEvent.get()
@@ -103,7 +103,7 @@ namespace slideshow::internal
bool EventQueue::addEventForNextRound( EventSharedPtr const& rEvent )
{
std::lock_guard aGuard( maMutex );
std::scoped_lock aGuard( maMutex );
SAL_INFO("slideshow.eventqueue", "adding event \"" << rEvent->GetDescription()
<< "\" [" << rEvent.get()
@@ -120,7 +120,7 @@ namespace slideshow::internal
bool EventQueue::addEventWhenQueueIsEmpty (const EventSharedPtr& rpEvent)
{
std::lock_guard aGuard( maMutex );
std::scoped_lock aGuard( maMutex );
SAL_INFO("slideshow.eventqueue", "adding event \"" << rpEvent->GetDescription()
<< "\" [" << rpEvent.get()
@@ -140,14 +140,14 @@ namespace slideshow::internal
void EventQueue::forceEmpty()
{
std::lock_guard aGuard( maMutex );
std::scoped_lock aGuard( maMutex );
process_(true);
}
void EventQueue::process()
{
std::lock_guard aGuard( maMutex );
std::scoped_lock aGuard( maMutex );
process_(false);
}
@@ -257,14 +257,14 @@ namespace slideshow::internal
bool EventQueue::isEmpty() const
{
std::lock_guard aGuard( maMutex );
std::scoped_lock aGuard( maMutex );
return maEvents.empty() && maNextEvents.empty() && maNextNextEvents.empty();
}
double EventQueue::nextTimeout() const
{
std::lock_guard aGuard( maMutex );
std::scoped_lock aGuard( maMutex );
// return time for next entry (if any)
double nTimeout (::std::numeric_limits<double>::max());
@@ -281,7 +281,7 @@ namespace slideshow::internal
void EventQueue::clear()
{
std::lock_guard aGuard( maMutex );
std::scoped_lock aGuard( maMutex );
// TODO(P1): Maybe a plain vector and vector.swap will
// be faster here. Profile.
+7 -7
View File
@@ -146,7 +146,7 @@ sal_Int32 SAL_CALL FileStreamWrapper_Impl::readBytes(Sequence< sal_Int8 >& aData
if (nBytesToRead < 0)
throw BufferSizeExceededException(OUString(),static_cast<XWeak*>(this));
std::lock_guard aGuard( m_aMutex );
std::scoped_lock aGuard( m_aMutex );
if (aData.getLength() < nBytesToRead)
aData.realloc(nBytesToRead);
@@ -190,7 +190,7 @@ void SAL_CALL FileStreamWrapper_Impl::skipBytes(sal_Int32 nBytesToSkip)
if ( m_aURL.isEmpty() )
return;
std::lock_guard aGuard( m_aMutex );
std::scoped_lock aGuard( m_aMutex );
checkError();
m_pSvStream->SeekRel(nBytesToSkip);
@@ -203,7 +203,7 @@ sal_Int32 SAL_CALL FileStreamWrapper_Impl::available()
if ( m_aURL.isEmpty() )
return 0;
std::lock_guard aGuard( m_aMutex );
std::scoped_lock aGuard( m_aMutex );
checkConnected();
sal_Int64 nAvailable = m_pSvStream->remainingSize();
@@ -218,7 +218,7 @@ void SAL_CALL FileStreamWrapper_Impl::closeInput()
if ( m_aURL.isEmpty() )
return;
std::lock_guard aGuard( m_aMutex );
std::scoped_lock aGuard( m_aMutex );
checkConnected();
m_pSvStream.reset();
#if OSL_DEBUG_LEVEL > 0
@@ -234,7 +234,7 @@ void SAL_CALL FileStreamWrapper_Impl::seek( sal_Int64 _nLocation )
if ( m_aURL.isEmpty() )
return;
std::lock_guard aGuard( m_aMutex );
std::scoped_lock aGuard( m_aMutex );
checkConnected();
m_pSvStream->Seek(static_cast<sal_uInt32>(_nLocation));
@@ -247,7 +247,7 @@ sal_Int64 SAL_CALL FileStreamWrapper_Impl::getPosition( )
if ( m_aURL.isEmpty() )
return 0;
std::lock_guard aGuard( m_aMutex );
std::scoped_lock aGuard( m_aMutex );
checkConnected();
sal_uInt32 nPos = m_pSvStream->Tell();
@@ -261,7 +261,7 @@ sal_Int64 SAL_CALL FileStreamWrapper_Impl::getLength( )
if ( m_aURL.isEmpty() )
return 0;
std::lock_guard aGuard( m_aMutex );
std::scoped_lock aGuard( m_aMutex );
checkConnected();
checkError();
+3 -3
View File
@@ -126,7 +126,7 @@ inline void LRU_Cache< t_Key, t_Val, t_KeyHash >::toFront( CacheEntry * pEntry )
template< class t_Key, class t_Val, class t_KeyHash >
inline t_Val LRU_Cache< t_Key, t_Val, t_KeyHash >::getValue( const t_Key & rKey ) const
{
std::lock_guard aGuard( _aCacheMutex );
std::scoped_lock aGuard( _aCacheMutex );
const typename t_Key2Element::const_iterator iFind( _aKey2Element.find( rKey ) );
if (iFind != _aKey2Element.end())
{
@@ -146,7 +146,7 @@ template< class t_Key, class t_Val, class t_KeyHash >
inline void LRU_Cache< t_Key, t_Val, t_KeyHash >::setValue(
const t_Key & rKey, const t_Val & rValue )
{
std::lock_guard aGuard( _aCacheMutex );
std::scoped_lock aGuard( _aCacheMutex );
if (_nCachedElements > 0)
{
const typename t_Key2Element::const_iterator iFind( _aKey2Element.find( rKey ) );
@@ -184,7 +184,7 @@ inline void LRU_Cache< t_Key, t_Val, t_KeyHash >::setValue(
template< class t_Key, class t_Val, class t_KeyHash >
inline void LRU_Cache< t_Key, t_Val, t_KeyHash >::clear()
{
std::lock_guard aGuard( _aCacheMutex );
std::scoped_lock aGuard( _aCacheMutex );
_aKey2Element.clear();
for ( sal_Int32 nPos = _nCachedElements; nPos--; )
{
+2 -2
View File
@@ -68,13 +68,13 @@ private:
void SAL_CALL InteractionRequest::RetryContinuation::select()
{
std::lock_guard aGuard(m_aMutex);
std::scoped_lock aGuard(m_aMutex);
m_bSelected = true;
}
bool InteractionRequest::RetryContinuation::isSelected() const
{
std::lock_guard aGuard(m_aMutex);
std::scoped_lock aGuard(m_aMutex);
return m_bSelected;
}
+3 -3
View File
@@ -89,7 +89,7 @@ Sequence< OUString > NamingService_Impl::getSupportedServiceNames()
// XServiceInfo
Reference< XInterface > NamingService_Impl::getRegisteredObject( const OUString& Name )
{
std::lock_guard aGuard( aMutex );
std::scoped_lock aGuard( aMutex );
Reference< XInterface > xRet;
HashMap_OWString_Interface::iterator aIt = aMap.find( Name );
if( aIt != aMap.end() )
@@ -100,14 +100,14 @@ Reference< XInterface > NamingService_Impl::getRegisteredObject( const OUString&
// XServiceInfo
void NamingService_Impl::registerObject( const OUString& Name, const Reference< XInterface >& Object )
{
std::lock_guard aGuard( aMutex );
std::scoped_lock aGuard( aMutex );
aMap[ Name ] = Object;
}
// XServiceInfo
void NamingService_Impl::revokeObject( const OUString& Name )
{
std::lock_guard aGuard( aMutex );
std::scoped_lock aGuard( aMutex );
aMap.erase( Name );
}
@@ -146,14 +146,14 @@ private:
// XEnumeration
sal_Bool ServiceEnumeration_Impl::hasMoreElements()
{
std::lock_guard aGuard( aMutex );
std::scoped_lock aGuard( aMutex );
return nIt != aFactories.getLength();
}
// XEnumeration
Any ServiceEnumeration_Impl::nextElement()
{
std::lock_guard aGuard( aMutex );
std::scoped_lock aGuard( aMutex );
if( nIt == aFactories.getLength() )
throw NoSuchElementException("no more elements");
@@ -224,14 +224,14 @@ private:
// XEnumeration
sal_Bool ImplementationEnumeration_Impl::hasMoreElements()
{
std::lock_guard aGuard( aMutex );
std::scoped_lock aGuard( aMutex );
return aIt != aImplementationMap.end();
}
// XEnumeration
Any ImplementationEnumeration_Impl::nextElement()
{
std::lock_guard aGuard( aMutex );
std::scoped_lock aGuard( aMutex );
if( aIt == aImplementationMap.end() )
throw NoSuchElementException("no more elements");
+33 -33
View File
@@ -179,18 +179,18 @@ private:
};
OUString Key::getKeyName() {
std::lock_guard guard(registry_->mutex_);
std::scoped_lock guard(registry_->mutex_);
return key_.getName();
}
sal_Bool Key::isReadOnly()
{
std::lock_guard guard(registry_->mutex_);
std::scoped_lock guard(registry_->mutex_);
return key_.isReadOnly();
}
sal_Bool Key::isValid() {
std::lock_guard guard(registry_->mutex_);
std::scoped_lock guard(registry_->mutex_);
return key_.isValid();
}
@@ -201,7 +201,7 @@ css::registry::RegistryKeyType Key::getKeyType(OUString const & )
css::registry::RegistryValueType Key::getValueType()
{
std::lock_guard guard(registry_->mutex_);
std::scoped_lock guard(registry_->mutex_);
RegValueType type;
sal_uInt32 size;
RegError err = key_.getValueInfo(OUString(), &type, &size);
@@ -242,7 +242,7 @@ css::registry::RegistryValueType Key::getValueType()
sal_Int32 Key::getLongValue()
{
std::lock_guard guard(registry_->mutex_);
std::scoped_lock guard(registry_->mutex_);
sal_Int32 value;
RegError err = key_.getValue(OUString(), &value);
switch (err) {
@@ -264,7 +264,7 @@ sal_Int32 Key::getLongValue()
void Key::setLongValue(sal_Int32 value)
{
std::lock_guard guard(registry_->mutex_);
std::scoped_lock guard(registry_->mutex_);
RegError err = key_.setValue(
OUString(), RegValueType::LONG, &value, sizeof (sal_Int32));
if (err != RegError::NO_ERROR) {
@@ -277,7 +277,7 @@ void Key::setLongValue(sal_Int32 value)
css::uno::Sequence< sal_Int32 > Key::getLongListValue()
{
std::lock_guard guard(registry_->mutex_);
std::scoped_lock guard(registry_->mutex_);
RegistryValueList< sal_Int32 > list;
RegError err = key_.getLongListValue(OUString(), list);
switch (err) {
@@ -313,7 +313,7 @@ css::uno::Sequence< sal_Int32 > Key::getLongListValue()
void Key::setLongListValue(css::uno::Sequence< sal_Int32 > const & seqValue)
{
std::lock_guard guard(registry_->mutex_);
std::scoped_lock guard(registry_->mutex_);
auto list = comphelper::sequenceToContainer<std::vector<sal_Int32>>(seqValue);
RegError err = key_.setLongListValue(
OUString(), list.data(), static_cast< sal_uInt32 >(list.size()));
@@ -327,7 +327,7 @@ void Key::setLongListValue(css::uno::Sequence< sal_Int32 > const & seqValue)
OUString Key::getAsciiValue()
{
std::lock_guard guard(registry_->mutex_);
std::scoped_lock guard(registry_->mutex_);
RegValueType type;
sal_uInt32 size;
RegError err = key_.getValueInfo(OUString(), &type, &size);
@@ -390,7 +390,7 @@ OUString Key::getAsciiValue()
void Key::setAsciiValue(OUString const & value)
{
std::lock_guard guard(registry_->mutex_);
std::scoped_lock guard(registry_->mutex_);
OString utf8;
if (!value.convertToString(
&utf8, RTL_TEXTENCODING_UTF8,
@@ -416,7 +416,7 @@ void Key::setAsciiValue(OUString const & value)
css::uno::Sequence< OUString > Key::getAsciiListValue()
{
std::lock_guard guard(registry_->mutex_);
std::scoped_lock guard(registry_->mutex_);
RegistryValueList< char * > list;
RegError err = key_.getStringListValue(OUString(), list);
switch (err) {
@@ -469,7 +469,7 @@ css::uno::Sequence< OUString > Key::getAsciiListValue()
void Key::setAsciiListValue(
css::uno::Sequence< OUString > const & seqValue)
{
std::lock_guard guard(registry_->mutex_);
std::scoped_lock guard(registry_->mutex_);
std::vector< OString > list;
for (const auto& rValue : seqValue) {
OString utf8;
@@ -503,7 +503,7 @@ void Key::setAsciiListValue(
OUString Key::getStringValue()
{
std::lock_guard guard(registry_->mutex_);
std::scoped_lock guard(registry_->mutex_);
RegValueType type;
sal_uInt32 size;
RegError err = key_.getValueInfo(OUString(), &type, &size);
@@ -554,7 +554,7 @@ OUString Key::getStringValue()
void Key::setStringValue(OUString const & value)
{
std::lock_guard guard(registry_->mutex_);
std::scoped_lock guard(registry_->mutex_);
RegError err = key_.setValue(
OUString(), RegValueType::UNICODE,
const_cast< sal_Unicode * >(value.getStr()),
@@ -570,7 +570,7 @@ void Key::setStringValue(OUString const & value)
css::uno::Sequence< OUString > Key::getStringListValue()
{
std::lock_guard guard(registry_->mutex_);
std::scoped_lock guard(registry_->mutex_);
RegistryValueList< sal_Unicode * > list;
RegError err = key_.getUnicodeListValue(OUString(), list);
switch (err) {
@@ -609,7 +609,7 @@ css::uno::Sequence< OUString > Key::getStringListValue()
void Key::setStringListValue(
css::uno::Sequence< OUString > const & seqValue)
{
std::lock_guard guard(registry_->mutex_);
std::scoped_lock guard(registry_->mutex_);
std::vector< sal_Unicode * > list;
list.reserve(seqValue.getLength());
std::transform(seqValue.begin(), seqValue.end(), std::back_inserter(list),
@@ -627,7 +627,7 @@ void Key::setStringListValue(
css::uno::Sequence< sal_Int8 > Key::getBinaryValue()
{
std::lock_guard guard(registry_->mutex_);
std::scoped_lock guard(registry_->mutex_);
RegValueType type;
sal_uInt32 size;
RegError err = key_.getValueInfo(OUString(), &type, &size);
@@ -662,7 +662,7 @@ css::uno::Sequence< sal_Int8 > Key::getBinaryValue()
void Key::setBinaryValue(css::uno::Sequence< sal_Int8 > const & value)
{
std::lock_guard guard(registry_->mutex_);
std::scoped_lock guard(registry_->mutex_);
RegError err = key_.setValue(
OUString(), RegValueType::BINARY,
const_cast< sal_Int8 * >(value.getConstArray()),
@@ -678,7 +678,7 @@ void Key::setBinaryValue(css::uno::Sequence< sal_Int8 > const & value)
css::uno::Reference< css::registry::XRegistryKey > Key::openKey(
OUString const & aKeyName)
{
std::lock_guard guard(registry_->mutex_);
std::scoped_lock guard(registry_->mutex_);
RegistryKey key;
RegError err = key_.openKey(aKeyName, key);
switch (err) {
@@ -697,7 +697,7 @@ css::uno::Reference< css::registry::XRegistryKey > Key::openKey(
css::uno::Reference< css::registry::XRegistryKey > Key::createKey(
OUString const & aKeyName)
{
std::lock_guard guard(registry_->mutex_);
std::scoped_lock guard(registry_->mutex_);
RegistryKey key;
RegError err = key_.createKey(aKeyName, key);
switch (err) {
@@ -715,7 +715,7 @@ css::uno::Reference< css::registry::XRegistryKey > Key::createKey(
void Key::closeKey()
{
std::lock_guard guard(registry_->mutex_);
std::scoped_lock guard(registry_->mutex_);
RegError err = key_.closeKey();
if (err != RegError::NO_ERROR) {
throw css::registry::InvalidRegistryException(
@@ -727,7 +727,7 @@ void Key::closeKey()
void Key::deleteKey(OUString const & rKeyName)
{
std::lock_guard guard(registry_->mutex_);
std::scoped_lock guard(registry_->mutex_);
RegError err = key_.deleteKey(rKeyName);
if (err != RegError::NO_ERROR) {
throw css::registry::InvalidRegistryException(
@@ -740,7 +740,7 @@ void Key::deleteKey(OUString const & rKeyName)
css::uno::Sequence< css::uno::Reference< css::registry::XRegistryKey > >
Key::openKeys()
{
std::lock_guard guard(registry_->mutex_);
std::scoped_lock guard(registry_->mutex_);
RegistryKeyArray list;
RegError err = key_.openSubKeys(OUString(), list);
if (err != RegError::NO_ERROR) {
@@ -767,7 +767,7 @@ Key::openKeys()
css::uno::Sequence< OUString > Key::getKeyNames()
{
std::lock_guard guard(registry_->mutex_);
std::scoped_lock guard(registry_->mutex_);
RegistryKeyNames list;
RegError err = key_.getKeyNames(OUString(), list);
if (err != RegError::NO_ERROR) {
@@ -814,7 +814,7 @@ OUString Key::getLinkTarget(OUString const & /*rLinkName*/)
OUString Key::getResolvedName(OUString const & aKeyName)
{
std::lock_guard guard(registry_->mutex_);
std::scoped_lock guard(registry_->mutex_);
OUString resolved;
RegError err = key_.getResolvedKeyName(aKeyName, resolved);
if (err != RegError::NO_ERROR) {
@@ -827,14 +827,14 @@ OUString Key::getResolvedName(OUString const & aKeyName)
}
OUString SimpleRegistry::getURL() {
std::lock_guard guard(mutex_);
std::scoped_lock guard(mutex_);
return registry_.getName();
}
void SimpleRegistry::open(
OUString const & rURL, sal_Bool bReadOnly, sal_Bool bCreate)
{
std::lock_guard guard(mutex_);
std::scoped_lock guard(mutex_);
RegError err = (rURL.isEmpty() && bCreate)
? RegError::REGISTRY_NOT_EXISTS
: registry_.open(rURL, bReadOnly ? RegAccessMode::READONLY : RegAccessMode::READWRITE);
@@ -850,13 +850,13 @@ void SimpleRegistry::open(
}
sal_Bool SimpleRegistry::isValid() {
std::lock_guard guard(mutex_);
std::scoped_lock guard(mutex_);
return registry_.isValid();
}
void SimpleRegistry::close()
{
std::lock_guard guard(mutex_);
std::scoped_lock guard(mutex_);
RegError err = registry_.close();
if (err != RegError::NO_ERROR) {
throw css::registry::InvalidRegistryException(
@@ -868,7 +868,7 @@ void SimpleRegistry::close()
void SimpleRegistry::destroy()
{
std::lock_guard guard(mutex_);
std::scoped_lock guard(mutex_);
RegError err = registry_.destroy(OUString());
if (err != RegError::NO_ERROR) {
throw css::registry::InvalidRegistryException(
@@ -880,7 +880,7 @@ void SimpleRegistry::destroy()
css::uno::Reference< css::registry::XRegistryKey > SimpleRegistry::getRootKey()
{
std::lock_guard guard(mutex_);
std::scoped_lock guard(mutex_);
RegistryKey root;
RegError err = registry_.openRootKey(root);
if (err != RegError::NO_ERROR) {
@@ -894,14 +894,14 @@ css::uno::Reference< css::registry::XRegistryKey > SimpleRegistry::getRootKey()
sal_Bool SimpleRegistry::isReadOnly()
{
std::lock_guard guard(mutex_);
std::scoped_lock guard(mutex_);
return registry_.isReadOnly();
}
void SimpleRegistry::mergeKey(
OUString const & aKeyName, OUString const & aUrl)
{
std::lock_guard guard(mutex_);
std::scoped_lock guard(mutex_);
RegistryKey root;
RegError err = registry_.openRootKey(root);
if (err == RegError::NO_ERROR) {
+2 -2
View File
@@ -75,7 +75,7 @@ void SAL_CALL ItemHolder2::disposing(const css::lang::EventObject&)
void ItemHolder2::impl_addItem(EItem eItem)
{
std::lock_guard aLock(m_aLock);
std::scoped_lock aLock(m_aLock);
for ( auto const & rInfo : m_lItems )
{
@@ -94,7 +94,7 @@ void ItemHolder2::impl_releaseAllItems()
{
std::vector< TItemInfo > items;
{
std::lock_guard aLock(m_aLock);
std::scoped_lock aLock(m_aLock);
items.swap(m_lItems);
}
+4 -4
View File
@@ -77,7 +77,7 @@ SharedStringPool::~SharedStringPool() {}
SharedString SharedStringPool::intern(const OUString& rStr)
{
StringWithHash aStrWithHash(rStr);
std::lock_guard<std::mutex> aGuard(mpImpl->maMutex);
std::scoped_lock<std::mutex> aGuard(mpImpl->maMutex);
auto[mapIt, bInserted] = mpImpl->maStrMap.emplace(aStrWithHash, rStr);
if (!bInserted)
@@ -112,7 +112,7 @@ SharedString SharedStringPool::intern(const OUString& rStr)
void SharedStringPool::purge()
{
std::lock_guard<std::mutex> aGuard(mpImpl->maMutex);
std::scoped_lock<std::mutex> aGuard(mpImpl->maMutex);
// Because we can have an uppercase entry mapped to itself,
// and then a bunch of lowercase entries mapped to that same
@@ -163,13 +163,13 @@ void SharedStringPool::purge()
size_t SharedStringPool::getCount() const
{
std::lock_guard<std::mutex> aGuard(mpImpl->maMutex);
std::scoped_lock<std::mutex> aGuard(mpImpl->maMutex);
return mpImpl->maStrMap.size();
}
size_t SharedStringPool::getCountIgnoreCase() const
{
std::lock_guard<std::mutex> aGuard(mpImpl->maMutex);
std::scoped_lock<std::mutex> aGuard(mpImpl->maMutex);
// this is only called from unit tests, so no need to be efficient
std::unordered_set<OUString> aUpperSet;
for (auto const& pair : mpImpl->maStrMap)
+2 -2
View File
@@ -86,7 +86,7 @@ void SAL_CALL ItemHolder2::disposing(const css::lang::EventObject&)
void ItemHolder2::impl_addItem(EItem eItem)
{
std::lock_guard aLock(m_aLock);
std::scoped_lock aLock(m_aLock);
for ( auto const & rInfo : m_lItems )
{
@@ -106,7 +106,7 @@ void ItemHolder2::impl_releaseAllItems()
{
std::vector<TItemInfo> items;
{
std::lock_guard aLock(m_aLock);
std::scoped_lock aLock(m_aLock);
items.swap(m_lItems);
}
@@ -127,7 +127,7 @@ static bool gbAllowAA = false;
bool IsAAPossibleOnThisSystem()
{
std::lock_guard aGuard(gaAntiAliasMutex);
std::scoped_lock aGuard(gaAntiAliasMutex);
if (!gbAllowAAInit)
{
gbAllowAAInit = true;
@@ -141,7 +141,7 @@ bool IsAntiAliasing()
{
bool bAntiAliasing;
{
std::lock_guard aGuard(gaAntiAliasMutex);
std::scoped_lock aGuard(gaAntiAliasMutex);
if (!gbAntiAliasingInit)
{
gbAntiAliasingInit = true;
@@ -159,7 +159,7 @@ bool IsAntiAliasing()
*/
void SetAntiAliasing( bool bOn, bool bTemporary )
{
std::lock_guard aGuard(gaAntiAliasMutex);
std::scoped_lock aGuard(gaAntiAliasMutex);
if (!bTemporary)
{
std::shared_ptr<comphelper::ConfigurationChanges> batch =
+3 -3
View File
@@ -37,7 +37,7 @@ void AsynchronLink::Call( void* pObj, bool bAllowDoubles )
_pArg = pObj;
DBG_ASSERT( bAllowDoubles || !_nEventId, "Already made a call" );
ClearPendingCall();
std::lock_guard aGuard(_aMutex);
std::scoped_lock aGuard(_aMutex);
_nEventId = Application::PostUserEvent( LINK( this, AsynchronLink, HandleCall_PostUserEvent) );
}
@@ -53,7 +53,7 @@ AsynchronLink::~AsynchronLink()
void AsynchronLink::ClearPendingCall()
{
std::lock_guard aGuard(_aMutex);
std::scoped_lock aGuard(_aMutex);
if( _nEventId )
{
Application::RemoveUserEvent( _nEventId );
@@ -64,7 +64,7 @@ void AsynchronLink::ClearPendingCall()
IMPL_LINK_NOARG( AsynchronLink, HandleCall_PostUserEvent, void*, void )
{
{
std::lock_guard aGuard(_aMutex);
std::scoped_lock aGuard(_aMutex);
_nEventId = nullptr;
// need to release the lock before calling the client since
// the client may call back into us
+5 -5
View File
@@ -155,7 +155,7 @@ void SvtMatchContext_Impl::Stop()
css::uno::Reference< css::ucb::XCommandProcessor > proc;
sal_Int32 id(0);
{
std::lock_guard g(mutex_);
std::scoped_lock g(mutex_);
if (!stopped_) {
stopped_ = true;
proc = processor_;
@@ -185,7 +185,7 @@ IMPL_LINK_NOARG( SvtMatchContext_Impl, Select_Impl, void*, void )
{
// avoid recursion through cancel button
{
std::lock_guard g(mutex_);
std::scoped_lock g(mutex_);
if (stopped_) {
// Completion was stopped, no display:
return;
@@ -403,7 +403,7 @@ void SvtMatchContext_Impl::doExecute()
::osl::MutexGuard aGuard( theSvtMatchContextMutex::get() );
{
// have we been stopped while we were waiting for the mutex?
std::lock_guard g(mutex_);
std::scoped_lock g(mutex_);
if (stopped_) {
return;
}
@@ -478,7 +478,7 @@ void SvtMatchContext_Impl::doExecute()
sal_Int32 id = proc->createCommandIdentifier();
try {
{
std::lock_guard g(mutex_);
std::scoped_lock g(mutex_);
processor_ = proc;
commandId_ = id;
}
@@ -503,7 +503,7 @@ void SvtMatchContext_Impl::doExecute()
proc2->releaseCommandIdentifier(id);
}
{
std::lock_guard g(mutex_);
std::scoped_lock g(mutex_);
processor_.clear();
// At least the neon-based WebDAV UCP does not
// properly support aborting commands, so return
+3 -3
View File
@@ -73,7 +73,7 @@ ValueItemAcc::~ValueItemAcc()
void ValueItemAcc::ParentDestroyed()
{
std::lock_guard aGuard( maMutex );
std::scoped_lock aGuard( maMutex );
mpParent = nullptr;
}
@@ -261,7 +261,7 @@ lang::Locale SAL_CALL ValueItemAcc::getLocale()
void SAL_CALL ValueItemAcc::addAccessibleEventListener( const uno::Reference< accessibility::XAccessibleEventListener >& rxListener )
{
std::lock_guard aGuard( maMutex );
std::scoped_lock aGuard( maMutex );
if( !rxListener.is() )
return;
@@ -284,7 +284,7 @@ void SAL_CALL ValueItemAcc::addAccessibleEventListener( const uno::Reference< ac
void SAL_CALL ValueItemAcc::removeAccessibleEventListener( const uno::Reference< accessibility::XAccessibleEventListener >& rxListener )
{
std::lock_guard aGuard( maMutex );
std::scoped_lock aGuard( maMutex );
if( rxListener.is() )
{
@@ -109,7 +109,7 @@ namespace accessibility
void SetOffset( const Point& );
Point GetOffset() const
{
std::lock_guard aGuard( maMutex ); Point aPoint( maOffset );
std::scoped_lock aGuard( maMutex ); Point aPoint( maOffset );
return aPoint;
}
@@ -732,7 +732,7 @@ namespace accessibility
{
// guard against non-atomic access to maOffset data structure
{
std::lock_guard aGuard( maMutex );
std::scoped_lock aGuard( maMutex );
maOffset = rPoint;
}
@@ -1383,7 +1383,7 @@ namespace accessibility
// -- object locked --
AccessibleEventObject aEvent;
{
std::lock_guard aGuard(maMutex);
std::scoped_lock aGuard(maMutex);
DBG_ASSERT(mxFrontEnd.is(), "AccessibleTextHelper::FireEvent: no event source set");
+2 -2
View File
@@ -173,7 +173,7 @@ namespace
OParseContextClient::OParseContextClient()
{
std::lock_guard aGuard( getSafetyMutex() );
std::scoped_lock aGuard( getSafetyMutex() );
++s_nCounter;
if ( 1 == s_nCounter )
{ // first instance
@@ -184,7 +184,7 @@ OParseContextClient::OParseContextClient()
OParseContextClient::~OParseContextClient()
{
std::lock_guard aGuard( getSafetyMutex() );
std::scoped_lock aGuard( getSafetyMutex() );
--s_nCounter;
if ( 0 == s_nCounter )
delete getSharedContext(nullptr,true);
+1 -1
View File
@@ -235,7 +235,7 @@ FmXDisposeListener::~FmXDisposeListener()
void FmXDisposeListener::setAdapter(FmXDisposeMultiplexer* pAdapter)
{
std::lock_guard aGuard(m_aMutex);
std::scoped_lock aGuard(m_aMutex);
m_pAdapter = pAdapter;
}
@@ -33,7 +33,7 @@ namespace drawinglayer::primitive2d
static basegfx::BColor aBColor;
static std::mutex aMutex;
std::lock_guard aGuard(aMutex);
std::scoped_lock aGuard(aMutex);
if(!aRetVal.get() || rBColor != aBColor)
{
+3 -3
View File
@@ -101,19 +101,19 @@ SvStream *OutputStorageWrapper_Impl::GetStream()
void SAL_CALL OutputStorageWrapper_Impl::writeBytes(
const Sequence< sal_Int8 >& aData)
{
std::lock_guard aGuard( maMutex );
std::scoped_lock aGuard( maMutex );
xOut->writeBytes( aData );
}
void SAL_CALL OutputStorageWrapper_Impl::flush()
{
std::lock_guard aGuard( maMutex );
std::scoped_lock aGuard( maMutex );
xOut->flush();
}
void SAL_CALL OutputStorageWrapper_Impl::closeOutput()
{
std::lock_guard aGuard( maMutex );
std::scoped_lock aGuard( maMutex );
xOut->closeOutput();
bStreamClosed = true;
}
+2 -2
View File
@@ -127,7 +127,7 @@ bool SwAccessibleCell::InvalidateMyCursorPos()
bool bNew = IsSelected();
bool bOld;
{
std::lock_guard aGuard( m_Mutex );
std::scoped_lock aGuard( m_Mutex );
bOld = m_bIsSelected;
m_bIsSelected = bNew;
}
@@ -227,7 +227,7 @@ void SwAccessibleCell::InvalidateCursorPos_()
bool SwAccessibleCell::HasCursor()
{
std::lock_guard aGuard( m_Mutex );
std::scoped_lock aGuard( m_Mutex );
return m_bIsSelected;
}
+9 -9
View File
@@ -66,7 +66,7 @@ void SwAccessibleContext::InitStates()
void SwAccessibleContext::SetParent( SwAccessibleContext *pParent )
{
std::lock_guard aGuard( m_Mutex );
std::scoped_lock aGuard( m_Mutex );
uno::Reference < XAccessible > xParent( pParent );
m_xWeakParent = xParent;
@@ -74,7 +74,7 @@ void SwAccessibleContext::SetParent( SwAccessibleContext *pParent )
uno::Reference< XAccessible > SwAccessibleContext::GetWeakParent() const
{
std::lock_guard aGuard( m_Mutex );
std::scoped_lock aGuard( m_Mutex );
uno::Reference< XAccessible > xParent( m_xWeakParent );
return xParent;
@@ -270,7 +270,7 @@ void SwAccessibleContext::Scrolled( const SwRect& rOldVisArea )
bool bIsOldShowingState;
bool bIsNewShowingState = IsShowing( *(GetMap()) );
{
std::lock_guard aGuard( m_Mutex );
std::scoped_lock aGuard( m_Mutex );
bIsOldShowingState = m_isShowingState;
m_isShowingState = bIsNewShowingState;
}
@@ -513,7 +513,7 @@ bool SwAccessibleContext::IsEditableState()
{
bool bRet;
{
std::lock_guard aGuard( m_Mutex );
std::scoped_lock aGuard( m_Mutex );
bRet = m_isEditableState;
}
@@ -676,7 +676,7 @@ uno::Reference< XAccessible> SwAccessibleContext::getAccessibleParentImpl()
// Remember the parent as weak ref.
{
std::lock_guard aWeakParentGuard( m_Mutex );
std::scoped_lock aWeakParentGuard( m_Mutex );
m_xWeakParent = xAcc;
}
@@ -1089,7 +1089,7 @@ void SwAccessibleContext::Dispose(bool bRecursive, bool bCanSkipInvisible)
// set defunc state (it's not required to broadcast a state changed
// event if the object is disposed afterwards)
{
std::lock_guard aDefuncStateGuard( m_Mutex );
std::scoped_lock aDefuncStateGuard( m_Mutex );
m_isDefuncState = true;
}
@@ -1160,7 +1160,7 @@ void SwAccessibleContext::InvalidatePosOrSize( const SwRect& )
bool bIsOldShowingState;
bool bIsNewShowingState = IsShowing( *(GetMap()) );
{
std::lock_guard aShowingStateGuard( m_Mutex );
std::scoped_lock aShowingStateGuard( m_Mutex );
bIsOldShowingState = m_isShowingState;
m_isShowingState = bIsNewShowingState;
}
@@ -1319,7 +1319,7 @@ void SwAccessibleContext::InvalidateStates( AccessibleStates _nStates )
bool bIsOldEditableState;
bool bIsNewEditableState = IsEditable( pVSh );
{
std::lock_guard aGuard( m_Mutex );
std::scoped_lock aGuard( m_Mutex );
bIsOldEditableState = m_isEditableState;
m_isEditableState = bIsNewEditableState;
}
@@ -1333,7 +1333,7 @@ void SwAccessibleContext::InvalidateStates( AccessibleStates _nStates )
bool bIsOldOpaqueState;
bool bIsNewOpaqueState = IsOpaque( pVSh );
{
std::lock_guard aGuard( m_Mutex );
std::scoped_lock aGuard( m_Mutex );
bIsOldOpaqueState = m_isOpaqueState;
m_isOpaqueState = bIsNewOpaqueState;
}
+3 -3
View File
@@ -141,7 +141,7 @@ void SwAccessibleFrameBase::InvalidateCursorPos_()
bool bOldSelected;
{
std::lock_guard aGuard( m_Mutex );
std::scoped_lock aGuard( m_Mutex );
bOldSelected = m_bIsSelected;
m_bIsSelected = bNewSelected;
}
@@ -188,7 +188,7 @@ void SwAccessibleFrameBase::InvalidateFocus_()
bool bSelected;
{
std::lock_guard aGuard( m_Mutex );
std::scoped_lock aGuard( m_Mutex );
bSelected = m_bIsSelected;
}
assert(bSelected && "focus object should be selected");
@@ -199,7 +199,7 @@ void SwAccessibleFrameBase::InvalidateFocus_()
bool SwAccessibleFrameBase::HasCursor()
{
std::lock_guard aGuard( m_Mutex );
std::scoped_lock aGuard( m_Mutex );
return m_bIsSelected;
}
+3 -3
View File
@@ -66,7 +66,7 @@ void SwAccessiblePage::InvalidateCursorPos_()
bool bOldSelected;
{
std::lock_guard aGuard( m_Mutex );
std::scoped_lock aGuard( m_Mutex );
bOldSelected = m_bIsSelected;
m_bIsSelected = bNewSelected;
}
@@ -96,7 +96,7 @@ void SwAccessiblePage::InvalidateFocus_()
bool bSelected;
{
std::lock_guard aGuard( m_Mutex );
std::scoped_lock aGuard( m_Mutex );
bSelected = m_bIsSelected;
}
OSL_ENSURE( bSelected, "focus object should be selected" );
@@ -125,7 +125,7 @@ SwAccessiblePage::~SwAccessiblePage()
bool SwAccessiblePage::HasCursor()
{
std::lock_guard aGuard( m_Mutex );
std::scoped_lock aGuard( m_Mutex );
return m_bIsSelected;
}
+7 -7
View File
@@ -287,7 +287,7 @@ void SwAccessibleParagraph::InvalidateContent_( bool bVisibleDataFired )
m_nHeadingLevel = GetRealHeadingLevel();
bool bOldIsHeading;
{
std::lock_guard aGuard( m_Mutex );
std::scoped_lock aGuard( m_Mutex );
bOldIsHeading = m_bIsHeading;
if( m_bIsHeading != bNewIsHeading )
m_bIsHeading = bNewIsHeading;
@@ -308,7 +308,7 @@ void SwAccessibleParagraph::InvalidateContent_( bool bVisibleDataFired )
OUString sNewDesc( GetDescription() );
OUString sOldDesc;
{
std::lock_guard aGuard( m_Mutex );
std::scoped_lock aGuard( m_Mutex );
sOldDesc = m_sDesc;
if( m_sDesc != sNewDesc )
m_sDesc = sNewDesc;
@@ -332,7 +332,7 @@ void SwAccessibleParagraph::InvalidateCursorPos_()
sal_Int32 nNew = GetCaretPos();
sal_Int32 nOld;
{
std::lock_guard aGuard( m_Mutex );
std::scoped_lock aGuard( m_Mutex );
nOld = m_nOldCaretPos;
m_nOldCaretPos = nNew;
}
@@ -383,7 +383,7 @@ void SwAccessibleParagraph::InvalidateFocus_()
{
sal_Int32 nPos;
{
std::lock_guard aGuard( m_Mutex );
std::scoped_lock aGuard( m_Mutex );
nPos = m_nOldCaretPos;
}
OSL_ENSURE( nPos != -1, "focus object should be selected" );
@@ -428,7 +428,7 @@ SwAccessibleParagraph::~SwAccessibleParagraph()
bool SwAccessibleParagraph::HasCursor()
{
std::lock_guard aGuard( m_Mutex );
std::scoped_lock aGuard( m_Mutex );
return m_nOldCaretPos != -1;
}
@@ -707,7 +707,7 @@ OUString SAL_CALL SwAccessibleParagraph::getAccessibleDescription()
ThrowIfDisposed();
std::lock_guard aGuard2( m_Mutex );
std::scoped_lock aGuard2( m_Mutex );
if( m_sDesc.isEmpty() )
m_sDesc = GetDescription();
@@ -1016,7 +1016,7 @@ sal_Int32 SwAccessibleParagraph::getCaretPosition()
sal_Int32 nRet = GetCaretPos();
{
std::lock_guard aOldCaretPosGuard( m_Mutex );
std::scoped_lock aOldCaretPosGuard( m_Mutex );
OSL_ENSURE( nRet == m_nOldCaretPos, "caret pos out of sync" );
m_nOldCaretPos = nRet;
}
@@ -67,7 +67,7 @@ class CancelJobsThread : public osl::Thread
void CancelJobsThread::addJobs( std::list< css::uno::Reference< css::util::XCancellable > >& rJobs )
{
std::lock_guard aGuard(maMutex);
std::scoped_lock aGuard(maMutex);
maJobs.insert( maJobs.end(), rJobs.begin(), rJobs.end() );
mbAllJobsCancelled = !maJobs.empty();
@@ -75,21 +75,21 @@ void CancelJobsThread::addJobs( std::list< css::uno::Reference< css::util::XCanc
bool CancelJobsThread::existJobs() const
{
std::lock_guard aGuard(maMutex);
std::scoped_lock aGuard(maMutex);
return !maJobs.empty();
}
bool CancelJobsThread::allJobsCancelled() const
{
std::lock_guard aGuard(maMutex);
std::scoped_lock aGuard(maMutex);
return maJobs.empty() && mbAllJobsCancelled;
}
void CancelJobsThread::stopWhenAllJobsCancelled()
{
std::lock_guard aGuard(maMutex);
std::scoped_lock aGuard(maMutex);
mbStopped = true;
}
@@ -99,7 +99,7 @@ css::uno::Reference< css::util::XCancellable > CancelJobsThread::getNextJob()
css::uno::Reference< css::util::XCancellable > xRet;
{
std::lock_guard aGuard(maMutex);
std::scoped_lock aGuard(maMutex);
if ( !maJobs.empty() )
{
@@ -113,7 +113,7 @@ css::uno::Reference< css::util::XCancellable > CancelJobsThread::getNextJob()
bool CancelJobsThread::stopped() const
{
std::lock_guard aGuard(maMutex);
std::scoped_lock aGuard(maMutex);
return mbStopped;
}
@@ -66,7 +66,7 @@ AccessibleRelationSetHelper::~AccessibleRelationSetHelper()
sal_Int32 SAL_CALL
AccessibleRelationSetHelper::getRelationCount( )
{
std::lock_guard aGuard (maMutex);
std::scoped_lock aGuard (maMutex);
return maRelations.size();
}
@@ -87,7 +87,7 @@ sal_Int32 SAL_CALL
AccessibleRelation SAL_CALL
AccessibleRelationSetHelper::getRelation( sal_Int32 nIndex )
{
std::lock_guard aGuard (maMutex);
std::scoped_lock aGuard (maMutex);
if ((nIndex < 0) || (o3tl::make_unsigned(nIndex) >= maRelations.size()))
throw lang::IndexOutOfBoundsException();
@@ -110,7 +110,7 @@ sal_Int32 SAL_CALL
sal_Bool SAL_CALL
AccessibleRelationSetHelper::containsRelation( sal_Int16 aRelationType )
{
std::lock_guard aGuard (maMutex);
std::scoped_lock aGuard (maMutex);
AccessibleRelation defaultRelation; // default is INVALID
AccessibleRelation relationByType = lcl_getRelationByType(maRelations, aRelationType);
@@ -131,14 +131,14 @@ sal_Bool SAL_CALL
AccessibleRelation SAL_CALL
AccessibleRelationSetHelper::getRelationByType( sal_Int16 aRelationType )
{
std::lock_guard aGuard (maMutex);
std::scoped_lock aGuard (maMutex);
return lcl_getRelationByType(maRelations, aRelationType);
}
void AccessibleRelationSetHelper::AddRelation(const AccessibleRelation& rRelation)
{
std::lock_guard aGuard (maMutex);
std::scoped_lock aGuard (maMutex);
for (auto& aRelation: maRelations)
{
@@ -70,7 +70,7 @@ AccessibleStateSetHelper::~AccessibleStateSetHelper()
*/
sal_Bool SAL_CALL AccessibleStateSetHelper::isEmpty ()
{
std::lock_guard aGuard (maMutex);
std::scoped_lock aGuard (maMutex);
return maStates == 0;
}
@@ -87,7 +87,7 @@ sal_Bool SAL_CALL AccessibleStateSetHelper::isEmpty ()
*/
sal_Bool SAL_CALL AccessibleStateSetHelper::contains (sal_Int16 aState)
{
std::lock_guard aGuard (maMutex);
std::scoped_lock aGuard (maMutex);
return lcl_contains(maStates, aState);
}
@@ -110,14 +110,14 @@ sal_Bool SAL_CALL AccessibleStateSetHelper::contains (sal_Int16 aState)
sal_Bool SAL_CALL AccessibleStateSetHelper::containsAll
(const uno::Sequence<sal_Int16>& rStateSet)
{
std::lock_guard aGuard (maMutex);
std::scoped_lock aGuard (maMutex);
return std::all_of(rStateSet.begin(), rStateSet.end(),
[this](const sal_Int16 nState) { return lcl_contains(maStates, nState); });
}
uno::Sequence<sal_Int16> SAL_CALL AccessibleStateSetHelper::getStates()
{
std::lock_guard aGuard(maMutex);
std::scoped_lock aGuard(maMutex);
uno::Sequence<sal_Int16> aRet(BITFIELDSIZE);
sal_Int16* pSeq = aRet.getArray();
sal_Int16 nStateCount(0);
@@ -134,7 +134,7 @@ uno::Sequence<sal_Int16> SAL_CALL AccessibleStateSetHelper::getStates()
void AccessibleStateSetHelper::AddState(sal_Int16 aState)
{
std::lock_guard aGuard (maMutex);
std::scoped_lock aGuard (maMutex);
DBG_ASSERT(aState < BITFIELDSIZE, "the statesset is too small");
sal_uInt64 aTempBitSet(1);
aTempBitSet <<= aState;
@@ -143,7 +143,7 @@ void AccessibleStateSetHelper::AddState(sal_Int16 aState)
void AccessibleStateSetHelper::RemoveState(sal_Int16 aState)
{
std::lock_guard aGuard (maMutex);
std::scoped_lock aGuard (maMutex);
DBG_ASSERT(aState < BITFIELDSIZE, "the statesset is too small");
sal_uInt64 aTempBitSet(1);
aTempBitSet <<= aState;
+2 -2
View File
@@ -86,7 +86,7 @@ void SAL_CALL ItemHolder1::disposing(const css::lang::EventObject&)
void ItemHolder1::impl_addItem(EItem eItem)
{
std::lock_guard aLock(m_aLock);
std::scoped_lock aLock(m_aLock);
for ( auto const & rInfo : m_lItems )
{
@@ -105,7 +105,7 @@ void ItemHolder1::impl_releaseAllItems()
{
std::vector< TItemInfo > items;
{
std::lock_guard aLock(m_aLock);
std::scoped_lock aLock(m_aLock);
items.swap(m_lItems);
}
+20 -20
View File
@@ -53,13 +53,13 @@ CharClass::~CharClass()
void CharClass::setLanguageTag( const LanguageTag& rLanguageTag )
{
std::lock_guard aGuard( aMutex );
std::scoped_lock aGuard( aMutex );
maLanguageTag = rLanguageTag;
}
const LanguageTag& CharClass::getLanguageTag() const
{
std::lock_guard aGuard( aMutex );
std::scoped_lock aGuard( aMutex );
return maLanguageTag;
}
@@ -115,7 +115,7 @@ bool CharClass::isAlpha( const OUString& rStr, sal_Int32 nPos ) const
{
if ( xCC.is() )
{
std::lock_guard aGuard( aMutex );
std::scoped_lock aGuard( aMutex );
return (xCC->getCharacterType( rStr, nPos, getMyLocale() ) &
nCharClassAlphaType) != 0;
}
@@ -137,7 +137,7 @@ bool CharClass::isLetter( const OUString& rStr, sal_Int32 nPos ) const
{
if ( xCC.is() )
{
std::lock_guard aGuard( aMutex );
std::scoped_lock aGuard( aMutex );
return (xCC->getCharacterType( rStr, nPos, getMyLocale() ) &
nCharClassLetterType) != 0;
}
@@ -155,7 +155,7 @@ bool CharClass::isLetter( const OUString& rStr ) const
{
if ( xCC.is() )
{
std::lock_guard aGuard( aMutex );
std::scoped_lock aGuard( aMutex );
return isLetterType( xCC->getStringType( rStr, 0, rStr.getLength(), getMyLocale() ) );
}
}
@@ -176,7 +176,7 @@ bool CharClass::isDigit( const OUString& rStr, sal_Int32 nPos ) const
{
if ( xCC.is() )
{
std::lock_guard aGuard( aMutex );
std::scoped_lock aGuard( aMutex );
return (xCC->getCharacterType( rStr, nPos, getMyLocale() ) &
KCharacterType::DIGIT) != 0;
}
@@ -194,7 +194,7 @@ bool CharClass::isNumeric( const OUString& rStr ) const
{
if ( xCC.is() )
{
std::lock_guard aGuard( aMutex );
std::scoped_lock aGuard( aMutex );
return isNumericType( xCC->getStringType( rStr, 0, rStr.getLength(), getMyLocale() ) );
}
}
@@ -215,7 +215,7 @@ bool CharClass::isAlphaNumeric( const OUString& rStr, sal_Int32 nPos ) const
{
if ( xCC.is() )
{
std::lock_guard aGuard( aMutex );
std::scoped_lock aGuard( aMutex );
return (xCC->getCharacterType( rStr, nPos, getMyLocale() ) &
(nCharClassAlphaType | KCharacterType::DIGIT)) != 0;
}
@@ -237,7 +237,7 @@ bool CharClass::isLetterNumeric( const OUString& rStr, sal_Int32 nPos ) const
{
if ( xCC.is() )
{
std::lock_guard aGuard( aMutex );
std::scoped_lock aGuard( aMutex );
return (xCC->getCharacterType( rStr, nPos, getMyLocale() ) &
(nCharClassLetterType | KCharacterType::DIGIT)) != 0;
}
@@ -255,7 +255,7 @@ bool CharClass::isLetterNumeric( const OUString& rStr ) const
{
if ( xCC.is() )
{
std::lock_guard aGuard( aMutex );
std::scoped_lock aGuard( aMutex );
return isLetterNumericType( xCC->getStringType( rStr, 0, rStr.getLength(), getMyLocale() ) );
}
}
@@ -272,7 +272,7 @@ OUString CharClass::titlecase(const OUString& rStr, sal_Int32 nPos, sal_Int32 nC
{
if ( xCC.is() )
{
std::lock_guard aGuard( aMutex );
std::scoped_lock aGuard( aMutex );
return xCC->toTitle( rStr, nPos, nCount, getMyLocale() );
}
}
@@ -289,7 +289,7 @@ OUString CharClass::uppercase( const OUString& rStr, sal_Int32 nPos, sal_Int32 n
{
if ( xCC.is() )
{
std::lock_guard aGuard( aMutex );
std::scoped_lock aGuard( aMutex );
return xCC->toUpper( rStr, nPos, nCount, getMyLocale() );
}
}
@@ -306,7 +306,7 @@ OUString CharClass::lowercase( const OUString& rStr, sal_Int32 nPos, sal_Int32 n
{
if ( xCC.is() )
{
std::lock_guard aGuard( aMutex );
std::scoped_lock aGuard( aMutex );
return xCC->toLower( rStr, nPos, nCount, getMyLocale() );
}
}
@@ -323,7 +323,7 @@ sal_Int16 CharClass::getType( const OUString& rStr, sal_Int32 nPos ) const
{
if ( xCC.is() )
{
std::lock_guard aGuard( aMutex );
std::scoped_lock aGuard( aMutex );
return xCC->getType( rStr, nPos );
}
}
@@ -340,7 +340,7 @@ css::i18n::DirectionProperty CharClass::getCharacterDirection( const OUString& r
{
if ( xCC.is() )
{
std::lock_guard aGuard( aMutex );
std::scoped_lock aGuard( aMutex );
return static_cast<css::i18n::DirectionProperty>(xCC->getCharacterDirection( rStr, nPos ));
}
}
@@ -357,7 +357,7 @@ css::i18n::UnicodeScript CharClass::getScript( const OUString& rStr, sal_Int32 n
{
if ( xCC.is() )
{
std::lock_guard aGuard( aMutex );
std::scoped_lock aGuard( aMutex );
return static_cast<css::i18n::UnicodeScript>(xCC->getScript( rStr, nPos ));
}
}
@@ -374,7 +374,7 @@ sal_Int32 CharClass::getCharacterType( const OUString& rStr, sal_Int32 nPos ) co
{
if ( xCC.is() )
{
std::lock_guard aGuard( aMutex );
std::scoped_lock aGuard( aMutex );
return xCC->getCharacterType( rStr, nPos, getMyLocale() );
}
}
@@ -391,7 +391,7 @@ sal_Int32 CharClass::getStringType( const OUString& rStr, sal_Int32 nPos, sal_In
{
if ( xCC.is() )
{
std::lock_guard aGuard( aMutex );
std::scoped_lock aGuard( aMutex );
return xCC->getStringType( rStr, nPos, nCount, getMyLocale() );
}
}
@@ -414,7 +414,7 @@ css::i18n::ParseResult CharClass::parseAnyToken(
{
if ( xCC.is() )
{
std::lock_guard aGuard( aMutex );
std::scoped_lock aGuard( aMutex );
return xCC->parseAnyToken( rStr, nPos, getMyLocale(),
nStartCharFlags, userDefinedCharactersStart,
nContCharFlags, userDefinedCharactersCont );
@@ -440,7 +440,7 @@ css::i18n::ParseResult CharClass::parsePredefinedToken(
{
if ( xCC.is() )
{
std::lock_guard aGuard( aMutex );
std::scoped_lock aGuard( aMutex );
return xCC->parsePredefinedToken( nTokenType, rStr, nPos, getMyLocale(),
nStartCharFlags, userDefinedCharactersStart,
nContCharFlags, userDefinedCharactersCont );
+1 -1
View File
@@ -104,7 +104,7 @@ Reference<XTextSearch2> TextSearch::getXTextSearch( const i18nutil::SearchOption
{
static CachedTextSearch theCachedTextSearch;
std::lock_guard aGuard(theCachedTextSearch.mutex);
std::scoped_lock aGuard(theCachedTextSearch.mutex);
if ( lcl_Equals(theCachedTextSearch.Options, rPara) )
return theCachedTextSearch.xTextSearch;
+6 -6
View File
@@ -36,7 +36,7 @@ sal_Int32 SAL_CALL OInputStreamHelper::readBytes(css::uno::Sequence< sal_Int8 >&
if (nBytesToRead < 0)
throw css::io::BufferSizeExceededException(OUString(), static_cast<css::uno::XWeak*>(this));
std::lock_guard aGuard( m_aMutex );
std::scoped_lock aGuard( m_aMutex );
if (aData.getLength() < nBytesToRead)
aData.realloc(nBytesToRead);
@@ -56,7 +56,7 @@ sal_Int32 SAL_CALL OInputStreamHelper::readBytes(css::uno::Sequence< sal_Int8 >&
void SAL_CALL OInputStreamHelper::seek( sal_Int64 location )
{
std::lock_guard aGuard( m_aMutex );
std::scoped_lock aGuard( m_aMutex );
m_nActPos = location;
}
@@ -70,7 +70,7 @@ sal_Int64 SAL_CALL OInputStreamHelper::getLength( )
if (!m_xLockBytes.is())
return 0;
std::lock_guard aGuard( m_aMutex );
std::scoped_lock aGuard( m_aMutex );
SvLockBytesStat aStat;
m_xLockBytes->Stat( &aStat );
return aStat.nSize;
@@ -85,7 +85,7 @@ sal_Int32 SAL_CALL OInputStreamHelper::readSomeBytes(css::uno::Sequence< sal_Int
void SAL_CALL OInputStreamHelper::skipBytes(sal_Int32 nBytesToSkip)
{
std::lock_guard aGuard( m_aMutex );
std::scoped_lock aGuard( m_aMutex );
if (!m_xLockBytes.is())
throw css::io::NotConnectedException(OUString(), static_cast<css::uno::XWeak*>(this));
@@ -97,7 +97,7 @@ void SAL_CALL OInputStreamHelper::skipBytes(sal_Int32 nBytesToSkip)
sal_Int32 SAL_CALL OInputStreamHelper::available()
{
std::lock_guard aGuard( m_aMutex );
std::scoped_lock aGuard( m_aMutex );
if (!m_xLockBytes.is())
throw css::io::NotConnectedException(OUString(), static_cast<css::uno::XWeak*>(this));
@@ -106,7 +106,7 @@ sal_Int32 SAL_CALL OInputStreamHelper::available()
void SAL_CALL OInputStreamHelper::closeInput()
{
std::lock_guard aGuard( m_aMutex );
std::scoped_lock aGuard( m_aMutex );
if (!m_xLockBytes.is())
throw css::io::NotConnectedException(OUString(), static_cast<css::uno::XWeak*>(this));
+7 -7
View File
@@ -63,7 +63,7 @@ sal_Int32 SAL_CALL OInputStreamWrapper::readBytes(css::uno::Sequence< sal_Int8 >
if (nBytesToRead < 0)
throw css::io::BufferSizeExceededException(OUString(),static_cast<css::uno::XWeak*>(this));
std::lock_guard aGuard( m_aMutex );
std::scoped_lock aGuard( m_aMutex );
if (aData.getLength() < nBytesToRead)
aData.realloc(nBytesToRead);
@@ -96,7 +96,7 @@ sal_Int32 SAL_CALL OInputStreamWrapper::readSomeBytes(css::uno::Sequence< sal_In
void SAL_CALL OInputStreamWrapper::skipBytes(sal_Int32 nBytesToSkip)
{
std::lock_guard aGuard( m_aMutex );
std::scoped_lock aGuard( m_aMutex );
checkError();
m_pSvStream->SeekRel(nBytesToSkip);
@@ -105,7 +105,7 @@ void SAL_CALL OInputStreamWrapper::skipBytes(sal_Int32 nBytesToSkip)
sal_Int32 SAL_CALL OInputStreamWrapper::available()
{
std::lock_guard aGuard( m_aMutex );
std::scoped_lock aGuard( m_aMutex );
checkConnected();
sal_Int64 nAvailable = m_pSvStream->remainingSize();
@@ -116,7 +116,7 @@ sal_Int32 SAL_CALL OInputStreamWrapper::available()
void SAL_CALL OInputStreamWrapper::closeInput()
{
std::lock_guard aGuard( m_aMutex );
std::scoped_lock aGuard( m_aMutex );
checkConnected();
if (m_bSvStreamOwner)
@@ -157,7 +157,7 @@ OSeekableInputStreamWrapper::OSeekableInputStreamWrapper(SvStream* _pStream, boo
void SAL_CALL OSeekableInputStreamWrapper::seek( sal_Int64 _nLocation )
{
std::lock_guard aGuard( m_aMutex );
std::scoped_lock aGuard( m_aMutex );
checkConnected();
m_pSvStream->Seek(static_cast<sal_uInt32>(_nLocation));
@@ -166,7 +166,7 @@ void SAL_CALL OSeekableInputStreamWrapper::seek( sal_Int64 _nLocation )
sal_Int64 SAL_CALL OSeekableInputStreamWrapper::getPosition( )
{
std::lock_guard aGuard( m_aMutex );
std::scoped_lock aGuard( m_aMutex );
checkConnected();
sal_uInt32 nPos = m_pSvStream->Tell();
@@ -176,7 +176,7 @@ sal_Int64 SAL_CALL OSeekableInputStreamWrapper::getPosition( )
sal_Int64 SAL_CALL OSeekableInputStreamWrapper::getLength( )
{
std::lock_guard aGuard( m_aMutex );
std::scoped_lock aGuard( m_aMutex );
checkConnected();
checkError();
+4 -4
View File
@@ -308,7 +308,7 @@ public:
virtual Reference<XStream> SAL_CALL getStream () override
{
std::lock_guard aGuard(m_aMutex);
std::scoped_lock aGuard(m_aMutex);
return m_xStream;
}
@@ -334,7 +334,7 @@ public:
virtual Reference<XInputStream> SAL_CALL getInputStream() override
{
std::lock_guard aGuard(m_aMutex);
std::scoped_lock aGuard(m_aMutex);
return m_xStream;
}
@@ -358,7 +358,7 @@ ModeratorsActiveDataSink::setInputStream (
)
{
m_aModerator.setInputStream(rxInputStream);
std::lock_guard aGuard(m_aMutex);
std::scoped_lock aGuard(m_aMutex);
m_xStream = rxInputStream;
}
@@ -376,7 +376,7 @@ ModeratorsActiveDataStreamer::setStream (
)
{
m_aModerator.setStream(rxStream);
std::lock_guard aGuard(m_aMutex);
std::scoped_lock aGuard(m_aMutex);
m_xStream = rxStream;
}
+6 -6
View File
@@ -129,7 +129,7 @@ namespace DOM
Reference< XDocument > SAL_CALL CDocumentBuilder::newDocument()
{
std::lock_guard const g(m_Mutex);
std::scoped_lock const g(m_Mutex);
// create a new document
xmlDocPtr pDocument = xmlNewDoc(reinterpret_cast<const xmlChar*>("1.0"));
@@ -333,7 +333,7 @@ namespace DOM
throw RuntimeException();
}
std::lock_guard const g(m_Mutex);
std::scoped_lock const g(m_Mutex);
// IO context struct. Must outlive pContext, as destroying that via
// xmlFreeParserCtxt may still access this context_t
@@ -364,7 +364,7 @@ namespace DOM
Reference< XDocument > SAL_CALL CDocumentBuilder::parseURI(const OUString& sUri)
{
std::lock_guard const g(m_Mutex);
std::scoped_lock const g(m_Mutex);
std::unique_ptr<xmlParserCtxt, XmlFreeParserCtxt> const pContext(
xmlNewParserCtxt());
@@ -403,14 +403,14 @@ namespace DOM
void SAL_CALL
CDocumentBuilder::setEntityResolver(Reference< XEntityResolver > const& xER)
{
std::lock_guard const g(m_Mutex);
std::scoped_lock const g(m_Mutex);
m_xEntityResolver = xER;
}
Reference< XEntityResolver > CDocumentBuilder::getEntityResolver()
{
std::lock_guard const g(m_Mutex);
std::scoped_lock const g(m_Mutex);
return m_xEntityResolver;
}
@@ -418,7 +418,7 @@ namespace DOM
void SAL_CALL
CDocumentBuilder::setErrorHandler(Reference< XErrorHandler > const& xEH)
{
std::lock_guard const g(m_Mutex);
std::scoped_lock const g(m_Mutex);
m_xErrorHandler = xEH;
}
+14 -14
View File
@@ -55,14 +55,14 @@ namespace DOM
SAXDocumentBuilderState SAL_CALL CSAXDocumentBuilder::getState()
{
std::lock_guard g(m_Mutex);
std::scoped_lock g(m_Mutex);
return m_aState;
}
void SAL_CALL CSAXDocumentBuilder::reset()
{
std::lock_guard g(m_Mutex);
std::scoped_lock g(m_Mutex);
m_aDocument.clear();
m_aFragment.clear();
@@ -72,7 +72,7 @@ namespace DOM
Reference< XDocument > SAL_CALL CSAXDocumentBuilder::getDocument()
{
std::lock_guard g(m_Mutex);
std::scoped_lock g(m_Mutex);
if (m_aState != SAXDocumentBuilderState_DOCUMENT_FINISHED)
throw RuntimeException();
@@ -82,7 +82,7 @@ namespace DOM
Reference< XDocumentFragment > SAL_CALL CSAXDocumentBuilder::getDocumentFragment()
{
std::lock_guard g(m_Mutex);
std::scoped_lock g(m_Mutex);
if (m_aState != SAXDocumentBuilderState_FRAGMENT_FINISHED)
throw RuntimeException();
@@ -91,7 +91,7 @@ namespace DOM
void SAL_CALL CSAXDocumentBuilder::startDocumentFragment(const Reference< XDocument >& ownerDoc)
{
std::lock_guard g(m_Mutex);
std::scoped_lock g(m_Mutex);
// start a new document fragment and push it onto the stack
// we have to be in a clean state to do this
@@ -107,7 +107,7 @@ namespace DOM
void SAL_CALL CSAXDocumentBuilder::endDocumentFragment()
{
std::lock_guard g(m_Mutex);
std::scoped_lock g(m_Mutex);
// there should only be the document left on the node stack
if (m_aState != SAXDocumentBuilderState_BUILDING_FRAGMENT)
@@ -123,7 +123,7 @@ namespace DOM
//XFastDocumentHandler
void SAL_CALL CSAXDocumentBuilder::startDocument()
{
std::lock_guard g(m_Mutex);
std::scoped_lock g(m_Mutex);
// start a new document and push it onto the stack
// we have to be in a clean state to do this
@@ -139,7 +139,7 @@ namespace DOM
void SAL_CALL CSAXDocumentBuilder::endDocument()
{
std::lock_guard g(m_Mutex);
std::scoped_lock g(m_Mutex);
// there should only be the document left on the node stack
if (m_aState != SAXDocumentBuilderState_BUILDING_DOCUMENT)
@@ -154,7 +154,7 @@ namespace DOM
void SAL_CALL CSAXDocumentBuilder::processingInstruction( const OUString& rTarget, const OUString& rData )
{
std::lock_guard g(m_Mutex);
std::scoped_lock g(m_Mutex);
// append PI node to the current top
if ( m_aState != SAXDocumentBuilderState_BUILDING_DOCUMENT &&
@@ -172,7 +172,7 @@ namespace DOM
void SAL_CALL CSAXDocumentBuilder::startFastElement( sal_Int32 nElement , const Reference< XFastAttributeList >& xAttribs )
{
std::lock_guard g(m_Mutex);
std::scoped_lock g(m_Mutex);
if ( m_aState != SAXDocumentBuilderState_BUILDING_DOCUMENT &&
m_aState != SAXDocumentBuilderState_BUILDING_FRAGMENT)
@@ -208,7 +208,7 @@ namespace DOM
// For arbitrary meta elements
void SAL_CALL CSAXDocumentBuilder::startUnknownElement( const OUString& rNamespace, const OUString& rName, const Reference< XFastAttributeList >& xAttribs )
{
std::lock_guard g(m_Mutex);
std::scoped_lock g(m_Mutex);
if ( m_aState != SAXDocumentBuilderState_BUILDING_DOCUMENT &&
m_aState != SAXDocumentBuilderState_BUILDING_FRAGMENT)
@@ -262,7 +262,7 @@ namespace DOM
void SAL_CALL CSAXDocumentBuilder::endFastElement( sal_Int32 nElement )
{
std::lock_guard g(m_Mutex);
std::scoped_lock g(m_Mutex);
// pop the current element from the stack
if ( m_aState != SAXDocumentBuilderState_BUILDING_DOCUMENT &&
@@ -285,7 +285,7 @@ namespace DOM
void SAL_CALL CSAXDocumentBuilder::endUnknownElement( const OUString& /*rNamespace*/, const OUString& rName )
{
std::lock_guard g(m_Mutex);
std::scoped_lock g(m_Mutex);
// pop the current element from the stack
if ( m_aState != SAXDocumentBuilderState_BUILDING_DOCUMENT &&
@@ -323,7 +323,7 @@ namespace DOM
void SAL_CALL CSAXDocumentBuilder::characters( const OUString& rChars )
{
std::lock_guard g(m_Mutex);
std::scoped_lock g(m_Mutex);
// append text node to the current top element
if (m_aState != SAXDocumentBuilderState_BUILDING_DOCUMENT &&
+26 -26
View File
@@ -443,7 +443,7 @@ public:
virtual ~librdf_GraphResult() override
{
std::lock_guard g(m_rMutex); // lock mutex when destroying members
std::scoped_lock g(m_rMutex); // lock mutex when destroying members
const_cast<std::shared_ptr<librdf_stream>& >(m_pStream).reset();
const_cast<std::shared_ptr<librdf_node>& >(m_pContext).reset();
const_cast<std::shared_ptr<librdf_query>& >(m_pQuery).reset();
@@ -479,7 +479,7 @@ private:
sal_Bool SAL_CALL
librdf_GraphResult::hasMoreElements()
{
std::lock_guard g(m_rMutex);
std::scoped_lock g(m_rMutex);
return m_pStream && !librdf_stream_end(m_pStream.get());
}
@@ -501,7 +501,7 @@ librdf_node* librdf_GraphResult::getContext_Lock() const
css::uno::Any SAL_CALL
librdf_GraphResult::nextElement()
{
std::lock_guard g(m_rMutex);
std::scoped_lock g(m_rMutex);
if (m_pStream && librdf_stream_end(m_pStream.get())) {
throw container::NoSuchElementException();
}
@@ -594,7 +594,7 @@ public:
virtual ~librdf_QuerySelectResult() override
{
std::lock_guard g(m_rMutex); // lock mutex when destroying members
std::scoped_lock g(m_rMutex); // lock mutex when destroying members
const_cast<std::shared_ptr<librdf_query_results>& >(m_pQueryResult)
.reset();
const_cast<std::shared_ptr<librdf_query>& >(m_pQuery).reset();
@@ -630,7 +630,7 @@ private:
sal_Bool SAL_CALL
librdf_QuerySelectResult::hasMoreElements()
{
std::lock_guard g(m_rMutex);
std::scoped_lock g(m_rMutex);
return !librdf_query_results_finished(m_pQueryResult.get());
}
@@ -651,7 +651,7 @@ public:
css::uno::Any SAL_CALL
librdf_QuerySelectResult::nextElement()
{
std::lock_guard g(m_rMutex);
std::scoped_lock g(m_rMutex);
if (librdf_query_results_finished(m_pQueryResult.get())) {
throw container::NoSuchElementException();
}
@@ -883,7 +883,7 @@ librdf_Repository::librdf_Repository(
{
OSL_ENSURE(i_xContext.is(), "librdf_Repository: null context");
std::lock_guard g(m_aMutex);
std::scoped_lock g(m_aMutex);
if (!m_NumInstances++) {
m_pWorld.reset(m_TypeConverter.createWorld_Lock(),
safe_librdf_free_world);
@@ -892,7 +892,7 @@ librdf_Repository::librdf_Repository(
librdf_Repository::~librdf_Repository()
{
std::lock_guard g(m_aMutex);
std::scoped_lock g(m_aMutex);
// must destroy these before world!
m_pModel.reset();
@@ -929,7 +929,7 @@ librdf_Repository::getSupportedServiceNames()
// css::rdf::XRepository:
uno::Reference< rdf::XBlankNode > SAL_CALL librdf_Repository::createBlankNode()
{
std::lock_guard g(m_aMutex);
std::scoped_lock g(m_aMutex);
const std::shared_ptr<librdf_node> pNode(
librdf_new_node_from_blank_identifier(m_pWorld.get(), nullptr),
safe_librdf_free_node);
@@ -1001,7 +1001,7 @@ librdf_Repository::importGraph(::sal_Int16 i_Format,
// exceptions are propagated
i_xInStream->readBytes( buf, static_cast<sal_Int32>( sz ) );
std::lock_guard g(m_aMutex); // don't call i_x* with mutex locked
std::scoped_lock g(m_aMutex); // don't call i_x* with mutex locked
if (m_NamedGraphs.find(contextU) != m_NamedGraphs.end()) {
throw container::ElementExistException(
@@ -1253,7 +1253,7 @@ librdf_Repository::exportGraph(::sal_Int16 i_Format,
uno::Sequence< uno::Reference< rdf::XURI > > SAL_CALL
librdf_Repository::getGraphNames()
{
std::lock_guard g(m_aMutex);
std::scoped_lock g(m_aMutex);
::std::vector< uno::Reference<rdf::XURI> > ret;
std::transform(m_NamedGraphs.begin(), m_NamedGraphs.end(),
std::back_inserter(ret),
@@ -1271,7 +1271,7 @@ librdf_Repository::getGraph(const uno::Reference< rdf::XURI > & i_xGraphName)
}
const OUString contextU( i_xGraphName->getStringValue() );
std::lock_guard g(m_aMutex);
std::scoped_lock g(m_aMutex);
const NamedGraphMap_t::iterator iter( m_NamedGraphs.find(contextU) );
if (iter != m_NamedGraphs.end()) {
return iter->second;
@@ -1295,7 +1295,7 @@ librdf_Repository::createGraph(const uno::Reference< rdf::XURI > & i_xGraphName)
"librdf_Repository::createGraph: URI is reserved", *this, 0);
}
std::lock_guard g(m_aMutex); // don't call i_x* with mutex locked
std::scoped_lock g(m_aMutex); // don't call i_x* with mutex locked
// NB: librdf does not have a concept of graphs as such;
// a librdf named graph exists iff the model contains a statement with
@@ -1320,7 +1320,7 @@ librdf_Repository::destroyGraph(
}
const OUString contextU( i_xGraphName->getStringValue() );
std::lock_guard g(m_aMutex); // don't call i_x* with mutex locked
std::scoped_lock g(m_aMutex); // don't call i_x* with mutex locked
const NamedGraphMap_t::iterator iter( clearGraph_Lock(contextU, false) );
m_NamedGraphs.erase(iter);
@@ -1352,7 +1352,7 @@ librdf_Repository::getStatements(
librdf_TypeConverter::extractStatement_NoLock(
i_xSubject, i_xPredicate, i_xObject));
std::lock_guard g(m_aMutex); // don't call i_x* with mutex locked
std::scoped_lock g(m_aMutex); // don't call i_x* with mutex locked
const std::shared_ptr<librdf_statement> pStatement(
librdf_TypeConverter::mkStatement_Lock(m_pWorld.get(), stmt),
@@ -1376,7 +1376,7 @@ librdf_Repository::getStatements(
uno::Reference< rdf::XQuerySelectResult > SAL_CALL
librdf_Repository::querySelect(const OUString & i_rQuery)
{
std::lock_guard g(m_aMutex);
std::scoped_lock g(m_aMutex);
const OString query(
OUStringToOString(i_rQuery, RTL_TEXTENCODING_UTF8) );
const std::shared_ptr<librdf_query> pQuery(
@@ -1422,7 +1422,7 @@ librdf_Repository::querySelect(const OUString & i_rQuery)
uno::Reference< container::XEnumeration > SAL_CALL
librdf_Repository::queryConstruct(const OUString & i_rQuery)
{
std::lock_guard g(m_aMutex);
std::scoped_lock g(m_aMutex);
const OString query(
OUStringToOString(i_rQuery, RTL_TEXTENCODING_UTF8) );
const std::shared_ptr<librdf_query> pQuery(
@@ -1458,7 +1458,7 @@ librdf_Repository::queryConstruct(const OUString & i_rQuery)
sal_Bool SAL_CALL
librdf_Repository::queryAsk(const OUString & i_rQuery)
{
std::lock_guard g(m_aMutex);
std::scoped_lock g(m_aMutex);
const OString query(
OUStringToOString(i_rQuery, RTL_TEXTENCODING_UTF8) );
@@ -1572,7 +1572,7 @@ void SAL_CALL librdf_Repository::setStatementRDFa(
removeStatementRDFa(i_xObject); // not atomic with insertion?
std::lock_guard g(m_aMutex); // don't call i_x* with mutex locked
std::scoped_lock g(m_aMutex); // don't call i_x* with mutex locked
if (i_rRDFaContent.isEmpty()) {
m_RDFaXHTMLContentSet.erase(sXmlId);
@@ -1655,7 +1655,7 @@ librdf_Repository::getStatementRDFa(
"cannot getStatementsGraph", *this, anyEx);
}
std::lock_guard g(m_aMutex); // don't call i_x* with mutex locked
std::scoped_lock g(m_aMutex); // don't call i_x* with mutex locked
return beans::Pair< uno::Sequence<rdf::Statement>, sal_Bool >(
comphelper::containerToSequence(ret), 0 != m_RDFaXHTMLContentSet.count(sXmlId));
@@ -1700,7 +1700,7 @@ librdf_Repository::getStatementsRDFa(
librdf_TypeConverter::extractStatement_NoLock(
i_xSubject, i_xPredicate, i_xObject));
std::lock_guard g(m_aMutex); // don't call i_x* with mutex locked
std::scoped_lock g(m_aMutex); // don't call i_x* with mutex locked
const std::shared_ptr<librdf_statement> pStatement(
librdf_TypeConverter::mkStatement_Lock(m_pWorld.get(), stmt),
@@ -1731,7 +1731,7 @@ librdf_Repository::getStatementsRDFa(
void SAL_CALL librdf_Repository::initialize(
const uno::Sequence< css::uno::Any > &)
{
std::lock_guard g(m_aMutex);
std::scoped_lock g(m_aMutex);
// m_pWorld.reset(m_TypeConverter.createWorld(), safe_librdf_free_world);
m_pStorage.reset(m_TypeConverter.createStorage_Lock(m_pWorld.get()),
@@ -1745,7 +1745,7 @@ NamedGraphMap_t::iterator librdf_Repository::clearGraph_NoLock(
// throw (uno::RuntimeException, container::NoSuchElementException,
// rdf::RepositoryException)
{
std::lock_guard g(m_aMutex);
std::scoped_lock g(m_aMutex);
return clearGraph_Lock(i_rGraphName, i_Internal);
}
@@ -1809,7 +1809,7 @@ void librdf_Repository::addStatementGraph_NoLock(
const OUString contextU( i_xGraphName->getStringValue() );
std::lock_guard g(m_aMutex); // don't call i_x* with mutex locked
std::scoped_lock g(m_aMutex); // don't call i_x* with mutex locked
addStatementGraph_Lock(stmt, contextU, false/*i_Internal*/);
}
@@ -1883,7 +1883,7 @@ void librdf_Repository::removeStatementsGraph_NoLock(
i_xSubject, i_xPredicate, i_xObject));
const OUString contextU( i_xGraphName->getStringValue() );
std::lock_guard g(m_aMutex); // don't call i_x* with mutex locked
std::scoped_lock g(m_aMutex); // don't call i_x* with mutex locked
if (m_NamedGraphs.find(contextU) == m_NamedGraphs.end()) {
throw container::NoSuchElementException(
@@ -1964,7 +1964,7 @@ librdf_Repository::getStatementsGraph_NoLock(
i_xSubject, i_xPredicate, i_xObject));
const OUString contextU( i_xGraphName->getStringValue() );
std::lock_guard g(m_aMutex); // don't call i_x* with mutex locked
std::scoped_lock g(m_aMutex); // don't call i_x* with mutex locked
if (!i_Internal && (m_NamedGraphs.find(contextU) == m_NamedGraphs.end())) {
throw container::NoSuchElementException(
+5 -5
View File
@@ -72,7 +72,7 @@ namespace XPath
const OUString& aPrefix,
const OUString& aURI)
{
std::lock_guard const g(m_Mutex);
std::scoped_lock const g(m_Mutex);
m_nsmap.emplace(aPrefix, aURI);
}
@@ -81,7 +81,7 @@ namespace XPath
const OUString& aPrefix,
const OUString& aURI)
{
std::lock_guard const g(m_Mutex);
std::scoped_lock const g(m_Mutex);
if ((m_nsmap.find(aPrefix))->second == aURI) {
m_nsmap.erase(aPrefix);
@@ -284,7 +284,7 @@ namespace XPath
extensions_t extensions;
{
std::lock_guard const g(m_Mutex);
std::scoped_lock const g(m_Mutex);
nsmap = m_nsmap;
extensions = m_extensions;
}
@@ -365,7 +365,7 @@ namespace XPath
void SAL_CALL CXPathAPI::registerExtension(
const OUString& aName)
{
std::lock_guard const g(m_Mutex);
std::scoped_lock const g(m_Mutex);
// get extension from service manager
Reference< XXPathExtension > const xExtension(
@@ -383,7 +383,7 @@ namespace XPath
if (!xExtension.is()) {
throw RuntimeException();
}
std::lock_guard const g(m_Mutex);
std::scoped_lock const g(m_Mutex);
m_extensions.push_back( xExtension );
}
}
+2 -2
View File
@@ -101,7 +101,7 @@ OUString extractActionType(const ActionDataMap& rData)
void JSDialogNotifyIdle::sendMessage(jsdialog::MessageType eType, VclPtr<vcl::Window> pWindow,
std::unique_ptr<ActionDataMap> pData)
{
std::lock_guard aGuard(m_aQueueMutex);
std::scoped_lock aGuard(m_aQueueMutex);
// we want only the latest update of same type
// TODO: also if we met full update - previous updates are not valid
@@ -261,7 +261,7 @@ void JSDialogNotifyIdle::Invoke()
{
std::deque<JSDialogMessageInfo> aMessageQueue;
{
std::lock_guard aGuard(m_aQueueMutex);
std::scoped_lock aGuard(m_aQueueMutex);
std::swap(aMessageQueue, m_aMessageQueue);
}
+2 -2
View File
@@ -325,7 +325,7 @@ GraphicFilter::GraphicFilter( bool bConfig )
GraphicFilter::~GraphicFilter()
{
{
std::lock_guard aGuard( getListMutex() );
std::scoped_lock aGuard( getListMutex() );
auto it = std::find(gaFilterHdlList.begin(), gaFilterHdlList.end(), this);
if( it != gaFilterHdlList.end() )
gaFilterHdlList.erase( it );
@@ -340,7 +340,7 @@ GraphicFilter::~GraphicFilter()
void GraphicFilter::ImplInit()
{
{
std::lock_guard aGuard( getListMutex() );
std::scoped_lock aGuard( getListMutex() );
if ( gaFilterHdlList.empty() )
pConfig = new FilterConfigCache( bUseConfig );
+2 -2
View File
@@ -71,7 +71,7 @@ GraphicObjectImpl::GraphicObjectImpl(const uno::Sequence<uno::Any>& /*rArgs*/)
uno::Reference<graphic::XGraphic> SAL_CALL GraphicObjectImpl::getGraphic()
{
std::lock_guard aGuard(m_aMutex);
std::scoped_lock aGuard(m_aMutex);
if (!mpGraphicObject)
throw uno::RuntimeException();
@@ -80,7 +80,7 @@ uno::Reference<graphic::XGraphic> SAL_CALL GraphicObjectImpl::getGraphic()
void SAL_CALL GraphicObjectImpl::setGraphic(uno::Reference<graphic::XGraphic> const & rxGraphic)
{
std::lock_guard aGuard(m_aMutex);
std::scoped_lock aGuard(m_aMutex);
if (!mpGraphicObject)
throw uno::RuntimeException();
@@ -56,7 +56,7 @@ void DisplayConnectionDispatch::terminate()
SolarMutexReleaser aRel;
std::lock_guard aGuard( m_aMutex );
std::scoped_lock aGuard( m_aMutex );
Any aEvent;
std::vector< css::uno::Reference< XEventHandler > > aLocalList( m_aHandlers );
for (auto const& elem : aLocalList)
@@ -65,14 +65,14 @@ void DisplayConnectionDispatch::terminate()
void SAL_CALL DisplayConnectionDispatch::addEventHandler( const Any& /*window*/, const css::uno::Reference< XEventHandler >& handler, sal_Int32 /*eventMask*/ )
{
std::lock_guard aGuard( m_aMutex );
std::scoped_lock aGuard( m_aMutex );
m_aHandlers.push_back( handler );
}
void SAL_CALL DisplayConnectionDispatch::removeEventHandler( const Any& /*window*/, const css::uno::Reference< XEventHandler >& handler )
{
std::lock_guard aGuard( m_aMutex );
std::scoped_lock aGuard( m_aMutex );
m_aHandlers.erase( std::remove(m_aHandlers.begin(), m_aHandlers.end(), handler), m_aHandlers.end() );
}
@@ -99,7 +99,7 @@ bool DisplayConnectionDispatch::dispatchEvent( void const * pData, int nBytes )
aEvent <<= aSeq;
::std::vector< css::uno::Reference< XEventHandler > > handlers;
{
std::lock_guard aGuard( m_aMutex );
std::scoped_lock aGuard( m_aMutex );
handlers = m_aHandlers;
}
for (auto const& handle : handlers)
+2 -2
View File
@@ -83,7 +83,7 @@ void DragSourceHelper::dispose()
{
Reference<XDragGestureRecognizer> xTmp;
{
std::lock_guard aGuard( maMutex );
std::scoped_lock aGuard( maMutex );
xTmp = std::move(mxDragGestureRecognizer);
}
if( xTmp.is() )
@@ -244,7 +244,7 @@ void DropTargetHelper::dispose()
{
Reference< XDropTarget > xTmp;
{
std::lock_guard aGuard( maMutex );
std::scoped_lock aGuard( maMutex );
xTmp = std::move(mxDropTarget);
}
if( xTmp.is() )
+6 -6
View File
@@ -86,7 +86,7 @@ void DNDEventDispatcher::designate_currentwindow(vcl::Window *pWindow)
void SAL_CALL DNDEventDispatcher::drop( const DropTargetDropEvent& dtde )
{
std::lock_guard aImplGuard( m_aMutex );
std::scoped_lock aImplGuard( m_aMutex );
Point location( dtde.LocationX, dtde.LocationY );
@@ -119,7 +119,7 @@ void SAL_CALL DNDEventDispatcher::drop( const DropTargetDropEvent& dtde )
void SAL_CALL DNDEventDispatcher::dragEnter( const DropTargetDragEnterEvent& dtdee )
{
std::lock_guard aImplGuard( m_aMutex );
std::scoped_lock aImplGuard( m_aMutex );
Point location( dtdee.LocationX, dtdee.LocationY );
vcl::Window * pChildWindow = findTopLevelWindow(location);
@@ -142,7 +142,7 @@ void SAL_CALL DNDEventDispatcher::dragEnter( const DropTargetDragEnterEvent& dtd
void SAL_CALL DNDEventDispatcher::dragExit( const DropTargetEvent& /*dte*/ )
{
std::lock_guard aImplGuard( m_aMutex );
std::scoped_lock aImplGuard( m_aMutex );
fireDragExitEvent( m_pCurrentWindow );
@@ -153,7 +153,7 @@ void SAL_CALL DNDEventDispatcher::dragExit( const DropTargetEvent& /*dte*/ )
void SAL_CALL DNDEventDispatcher::dragOver( const DropTargetDragEvent& dtde )
{
std::lock_guard aImplGuard( m_aMutex );
std::scoped_lock aImplGuard( m_aMutex );
Point location( dtde.LocationX, dtde.LocationY );
sal_Int32 nListeners;
@@ -189,7 +189,7 @@ void SAL_CALL DNDEventDispatcher::dragOver( const DropTargetDragEvent& dtde )
void SAL_CALL DNDEventDispatcher::dropActionChanged( const DropTargetDragEvent& dtde )
{
std::lock_guard aImplGuard( m_aMutex );
std::scoped_lock aImplGuard( m_aMutex );
Point location( dtde.LocationX, dtde.LocationY );
sal_Int32 nListeners;
@@ -225,7 +225,7 @@ void SAL_CALL DNDEventDispatcher::dropActionChanged( const DropTargetDragEvent&
void SAL_CALL DNDEventDispatcher::dragGestureRecognized( const DragGestureEvent& dge )
{
std::lock_guard aImplGuard( m_aMutex );
std::scoped_lock aImplGuard( m_aMutex );
Point origin( dge.DragOriginX, dge.DragOriginY );
+1 -1
View File
@@ -535,7 +535,7 @@ OUString PPDParser::getPPDFile( const OUString& rFile )
const PPDParser* PPDParser::getParser( const OUString& rFile )
{
static std::recursive_mutex aMutex;
std::lock_guard aGuard( aMutex );
std::scoped_lock aGuard( aMutex );
OUString aFile = rFile;
if( !rFile.startsWith( "CUPS:" ) && !rFile.startsWith( "CPD:" ) )
@@ -903,7 +903,7 @@ void SAL_CALL InputStreamTransformer::release() noexcept
sal_Int32 SAL_CALL InputStreamTransformer::readBytes( Sequence< sal_Int8 >& aData,sal_Int32 nBytesToRead )
{
std::lock_guard aGuard( m_aMutex );
std::scoped_lock aGuard( m_aMutex );
int curr,available_ = buffer.getLength() - pos;
if( nBytesToRead <= available_ )
@@ -929,14 +929,14 @@ sal_Int32 SAL_CALL InputStreamTransformer::readSomeBytes( Sequence< sal_Int8 >&
void SAL_CALL InputStreamTransformer::skipBytes( sal_Int32 nBytesToSkip )
{
std::lock_guard aGuard( m_aMutex );
std::scoped_lock aGuard( m_aMutex );
while( nBytesToSkip-- ) ++pos;
}
sal_Int32 SAL_CALL InputStreamTransformer::available()
{
std::lock_guard aGuard( m_aMutex );
std::scoped_lock aGuard( m_aMutex );
return std::min<sal_Int64>(SAL_MAX_INT32, buffer.getLength() - pos);
}
@@ -948,7 +948,7 @@ void SAL_CALL InputStreamTransformer::closeInput()
void SAL_CALL InputStreamTransformer::seek( sal_Int64 location )
{
std::lock_guard aGuard( m_aMutex );
std::scoped_lock aGuard( m_aMutex );
if( location < 0 )
throw IllegalArgumentException();
@@ -961,14 +961,14 @@ void SAL_CALL InputStreamTransformer::seek( sal_Int64 location )
sal_Int64 SAL_CALL InputStreamTransformer::getPosition()
{
std::lock_guard aGuard( m_aMutex );
std::scoped_lock aGuard( m_aMutex );
return sal_Int64( pos );
}
sal_Int64 SAL_CALL InputStreamTransformer::getLength()
{
std::lock_guard aGuard( m_aMutex );
std::scoped_lock aGuard( m_aMutex );
return buffer.getLength();
}
@@ -976,7 +976,7 @@ sal_Int64 SAL_CALL InputStreamTransformer::getLength()
void InputStreamTransformer::addToBuffer( const char* buffer_,int len_ )
{
std::lock_guard aGuard( m_aMutex );
std::scoped_lock aGuard( m_aMutex );
buffer.append( buffer_, len_ );
}
+1 -1
View File
@@ -1081,7 +1081,7 @@ OUString TreeFileIterator::expandURL( const OUString& aURL )
static Reference< util::XMacroExpander > xMacroExpander;
static Reference< uri::XUriReferenceFactory > xFac;
std::lock_guard aGuard( m_aMutex );
std::scoped_lock aGuard( m_aMutex );
if( !xMacroExpander.is() || !xFac.is() )
{
+1 -1
View File
@@ -2270,7 +2270,7 @@ void SvXMLExport::SetError(
{
// allow multi-threaded access to the cancel() method
static std::mutex aMutex;
std::lock_guard aGuard(aMutex);
std::scoped_lock aGuard(aMutex);
// maintain error flags
if ( ( nId & XMLERROR_FLAG_ERROR ) != 0 )
@@ -60,7 +60,7 @@ namespace xmlscript
void XMLBasicExporterBase::initialize( const Sequence< Any >& aArguments )
{
std::lock_guard aGuard( m_aMutex );
std::scoped_lock aGuard( m_aMutex );
if ( aArguments.getLength() != 1 )
{
@@ -79,7 +79,7 @@ namespace xmlscript
void XMLBasicExporterBase::setSourceDocument( const Reference< XComponent >& rxDoc )
{
std::lock_guard aGuard( m_aMutex );
std::scoped_lock aGuard( m_aMutex );
m_xModel.set( rxDoc, UNO_QUERY );
@@ -93,7 +93,7 @@ namespace xmlscript
sal_Bool XMLBasicExporterBase::filter( const Sequence< beans::PropertyValue >& /*aDescriptor*/ )
{
std::lock_guard aGuard( m_aMutex );
std::scoped_lock aGuard( m_aMutex );
bool bReturn = true;
@@ -306,7 +306,7 @@ sal_Bool XMLBasicExporterBase::filter( const Sequence< beans::PropertyValue >& /
void XMLBasicExporterBase::cancel()
{
std::lock_guard aGuard( m_aMutex );
std::scoped_lock aGuard( m_aMutex );
// cancel export
}
@@ -37,7 +37,7 @@ ODigestContext::~ODigestContext()
void SAL_CALL ODigestContext::updateDigest( const uno::Sequence< ::sal_Int8 >& aData )
{
std::lock_guard aGuard( m_aMutex );
std::scoped_lock aGuard( m_aMutex );
if ( m_bBroken )
throw uno::RuntimeException();
@@ -65,7 +65,7 @@ void SAL_CALL ODigestContext::updateDigest( const uno::Sequence< ::sal_Int8 >& a
uno::Sequence< ::sal_Int8 > SAL_CALL ODigestContext::finalizeDigestAndDispose()
{
std::lock_guard aGuard( m_aMutex );
std::scoped_lock aGuard( m_aMutex );
if ( m_bBroken )
throw uno::RuntimeException();
@@ -211,7 +211,7 @@ void SecurityEnvironment_NssImpl::adoptSymKey( PK11SymKey* aSymKey ) {
void SecurityEnvironment_NssImpl::updateSlots()
{
//In case new tokens are present then we can obtain the corresponding slot
std::lock_guard guard(m_mutex);
std::scoped_lock guard(m_mutex);
m_Slots.clear();
m_tSymKeyList.clear();