osl::Mutex->std::mutex in ImplIntrospectionAccess
Change-Id: I311762ccaac48161c8ce38f8ce081bf01e27ab09 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127904 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
committed by
Noel Grandin
parent
527e33784a
commit
c87c58feb2
@@ -24,11 +24,11 @@
|
|||||||
#include <limits>
|
#include <limits>
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
#include <mutex>
|
||||||
#include <set>
|
#include <set>
|
||||||
|
|
||||||
#include <o3tl/any.hxx>
|
#include <o3tl/any.hxx>
|
||||||
#include <osl/diagnose.h>
|
#include <osl/diagnose.h>
|
||||||
#include <osl/mutex.hxx>
|
|
||||||
#include <sal/log.hxx>
|
#include <sal/log.hxx>
|
||||||
#include <cppuhelper/basemutex.hxx>
|
#include <cppuhelper/basemutex.hxx>
|
||||||
#include <cppuhelper/compbase.hxx>
|
#include <cppuhelper/compbase.hxx>
|
||||||
@@ -660,7 +660,7 @@ class ImplIntrospectionAccess : public IntrospectionAccessHelper
|
|||||||
sal_Int32 mnLastMethodConcept;
|
sal_Int32 mnLastMethodConcept;
|
||||||
|
|
||||||
// Guards the caching of queried interfaces
|
// Guards the caching of queried interfaces
|
||||||
osl::Mutex m_aMutex;
|
std::mutex m_aMutex;
|
||||||
|
|
||||||
// Original interfaces of the objects
|
// Original interfaces of the objects
|
||||||
Reference<XElementAccess> mxObjElementAccess;
|
Reference<XElementAccess> mxObjElementAccess;
|
||||||
@@ -782,13 +782,13 @@ ImplIntrospectionAccess::ImplIntrospectionAccess
|
|||||||
|
|
||||||
Reference<XElementAccess> ImplIntrospectionAccess::getXElementAccess()
|
Reference<XElementAccess> ImplIntrospectionAccess::getXElementAccess()
|
||||||
{
|
{
|
||||||
ResettableGuard< Mutex > aGuard( m_aMutex );
|
std::unique_lock aGuard( m_aMutex );
|
||||||
|
|
||||||
if( !mxObjElementAccess.is() )
|
if( !mxObjElementAccess.is() )
|
||||||
{
|
{
|
||||||
aGuard.clear();
|
aGuard.unlock();
|
||||||
Reference<XElementAccess> xElementAccess( mxIface, UNO_QUERY );
|
Reference<XElementAccess> xElementAccess( mxIface, UNO_QUERY );
|
||||||
aGuard.reset();
|
aGuard.lock();
|
||||||
if( !mxObjElementAccess.is() )
|
if( !mxObjElementAccess.is() )
|
||||||
mxObjElementAccess = xElementAccess;
|
mxObjElementAccess = xElementAccess;
|
||||||
}
|
}
|
||||||
@@ -817,7 +817,7 @@ void ImplIntrospectionAccess::cacheXNameContainer()
|
|||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
MutexGuard aGuard( m_aMutex );
|
std::unique_lock aGuard( m_aMutex );
|
||||||
if( !mxObjNameContainer.is() )
|
if( !mxObjNameContainer.is() )
|
||||||
mxObjNameContainer = xNameContainer;
|
mxObjNameContainer = xNameContainer;
|
||||||
if( !mxObjNameReplace.is() )
|
if( !mxObjNameReplace.is() )
|
||||||
@@ -829,11 +829,11 @@ void ImplIntrospectionAccess::cacheXNameContainer()
|
|||||||
|
|
||||||
Reference<XNameContainer> ImplIntrospectionAccess::getXNameContainer()
|
Reference<XNameContainer> ImplIntrospectionAccess::getXNameContainer()
|
||||||
{
|
{
|
||||||
ClearableGuard< Mutex > aGuard( m_aMutex );
|
std::unique_lock aGuard( m_aMutex );
|
||||||
|
|
||||||
if( !mxObjNameContainer.is() )
|
if( !mxObjNameContainer.is() )
|
||||||
{
|
{
|
||||||
aGuard.clear();
|
aGuard.unlock();
|
||||||
cacheXNameContainer();
|
cacheXNameContainer();
|
||||||
}
|
}
|
||||||
return mxObjNameContainer;
|
return mxObjNameContainer;
|
||||||
@@ -841,11 +841,11 @@ Reference<XNameContainer> ImplIntrospectionAccess::getXNameContainer()
|
|||||||
|
|
||||||
Reference<XNameReplace> ImplIntrospectionAccess::getXNameReplace()
|
Reference<XNameReplace> ImplIntrospectionAccess::getXNameReplace()
|
||||||
{
|
{
|
||||||
ClearableGuard< Mutex > aGuard( m_aMutex );
|
std::unique_lock aGuard( m_aMutex );
|
||||||
|
|
||||||
if( !mxObjNameReplace.is() )
|
if( !mxObjNameReplace.is() )
|
||||||
{
|
{
|
||||||
aGuard.clear();
|
aGuard.unlock();
|
||||||
cacheXNameContainer();
|
cacheXNameContainer();
|
||||||
}
|
}
|
||||||
return mxObjNameReplace;
|
return mxObjNameReplace;
|
||||||
@@ -853,11 +853,11 @@ Reference<XNameReplace> ImplIntrospectionAccess::getXNameReplace()
|
|||||||
|
|
||||||
Reference<XNameAccess> ImplIntrospectionAccess::getXNameAccess()
|
Reference<XNameAccess> ImplIntrospectionAccess::getXNameAccess()
|
||||||
{
|
{
|
||||||
ClearableGuard< Mutex > aGuard( m_aMutex );
|
std::unique_lock aGuard( m_aMutex );
|
||||||
|
|
||||||
if( !mxObjNameAccess.is() )
|
if( !mxObjNameAccess.is() )
|
||||||
{
|
{
|
||||||
aGuard.clear();
|
aGuard.unlock();
|
||||||
cacheXNameContainer();
|
cacheXNameContainer();
|
||||||
}
|
}
|
||||||
return mxObjNameAccess;
|
return mxObjNameAccess;
|
||||||
@@ -885,7 +885,7 @@ void ImplIntrospectionAccess::cacheXIndexContainer()
|
|||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
MutexGuard aGuard( m_aMutex );
|
std::unique_lock aGuard( m_aMutex );
|
||||||
if( !mxObjIndexContainer.is() )
|
if( !mxObjIndexContainer.is() )
|
||||||
mxObjIndexContainer = xIndexContainer;
|
mxObjIndexContainer = xIndexContainer;
|
||||||
if( !mxObjIndexReplace.is() )
|
if( !mxObjIndexReplace.is() )
|
||||||
@@ -897,11 +897,11 @@ void ImplIntrospectionAccess::cacheXIndexContainer()
|
|||||||
|
|
||||||
Reference<XIndexContainer> ImplIntrospectionAccess::getXIndexContainer()
|
Reference<XIndexContainer> ImplIntrospectionAccess::getXIndexContainer()
|
||||||
{
|
{
|
||||||
ClearableGuard< Mutex > aGuard( m_aMutex );
|
std::unique_lock aGuard( m_aMutex );
|
||||||
|
|
||||||
if( !mxObjIndexContainer.is() )
|
if( !mxObjIndexContainer.is() )
|
||||||
{
|
{
|
||||||
aGuard.clear();
|
aGuard.unlock();
|
||||||
cacheXIndexContainer();
|
cacheXIndexContainer();
|
||||||
}
|
}
|
||||||
return mxObjIndexContainer;
|
return mxObjIndexContainer;
|
||||||
@@ -909,11 +909,11 @@ Reference<XIndexContainer> ImplIntrospectionAccess::getXIndexContainer()
|
|||||||
|
|
||||||
Reference<XIndexReplace> ImplIntrospectionAccess::getXIndexReplace()
|
Reference<XIndexReplace> ImplIntrospectionAccess::getXIndexReplace()
|
||||||
{
|
{
|
||||||
ClearableGuard< Mutex > aGuard( m_aMutex );
|
std::unique_lock aGuard( m_aMutex );
|
||||||
|
|
||||||
if( !mxObjIndexReplace.is() )
|
if( !mxObjIndexReplace.is() )
|
||||||
{
|
{
|
||||||
aGuard.clear();
|
aGuard.unlock();
|
||||||
cacheXIndexContainer();
|
cacheXIndexContainer();
|
||||||
}
|
}
|
||||||
return mxObjIndexReplace;
|
return mxObjIndexReplace;
|
||||||
@@ -921,11 +921,11 @@ Reference<XIndexReplace> ImplIntrospectionAccess::getXIndexReplace()
|
|||||||
|
|
||||||
Reference<XIndexAccess> ImplIntrospectionAccess::getXIndexAccess()
|
Reference<XIndexAccess> ImplIntrospectionAccess::getXIndexAccess()
|
||||||
{
|
{
|
||||||
ClearableGuard< Mutex > aGuard( m_aMutex );
|
std::unique_lock aGuard( m_aMutex );
|
||||||
|
|
||||||
if( !mxObjIndexAccess.is() )
|
if( !mxObjIndexAccess.is() )
|
||||||
{
|
{
|
||||||
aGuard.clear();
|
aGuard.unlock();
|
||||||
cacheXIndexContainer();
|
cacheXIndexContainer();
|
||||||
}
|
}
|
||||||
return mxObjIndexAccess;
|
return mxObjIndexAccess;
|
||||||
@@ -933,13 +933,13 @@ Reference<XIndexAccess> ImplIntrospectionAccess::getXIndexAccess()
|
|||||||
|
|
||||||
Reference<XEnumerationAccess> ImplIntrospectionAccess::getXEnumerationAccess()
|
Reference<XEnumerationAccess> ImplIntrospectionAccess::getXEnumerationAccess()
|
||||||
{
|
{
|
||||||
ResettableGuard< Mutex > aGuard( m_aMutex );
|
std::unique_lock aGuard( m_aMutex );
|
||||||
|
|
||||||
if( !mxObjEnumerationAccess.is() )
|
if( !mxObjEnumerationAccess.is() )
|
||||||
{
|
{
|
||||||
aGuard.clear();
|
aGuard.unlock();
|
||||||
Reference<XEnumerationAccess> xEnumerationAccess( mxIface, UNO_QUERY );
|
Reference<XEnumerationAccess> xEnumerationAccess( mxIface, UNO_QUERY );
|
||||||
aGuard.reset();
|
aGuard.lock();
|
||||||
if( !mxObjEnumerationAccess.is() )
|
if( !mxObjEnumerationAccess.is() )
|
||||||
mxObjEnumerationAccess = xEnumerationAccess;
|
mxObjEnumerationAccess = xEnumerationAccess;
|
||||||
}
|
}
|
||||||
@@ -948,13 +948,13 @@ Reference<XEnumerationAccess> ImplIntrospectionAccess::getXEnumerationAccess()
|
|||||||
|
|
||||||
Reference<XIdlArray> ImplIntrospectionAccess::getXIdlArray()
|
Reference<XIdlArray> ImplIntrospectionAccess::getXIdlArray()
|
||||||
{
|
{
|
||||||
ResettableGuard< Mutex > aGuard( m_aMutex );
|
std::unique_lock aGuard( m_aMutex );
|
||||||
|
|
||||||
if( !mxObjIdlArray.is() )
|
if( !mxObjIdlArray.is() )
|
||||||
{
|
{
|
||||||
aGuard.clear();
|
aGuard.unlock();
|
||||||
Reference<XIdlArray> xIdlArray( mxIface, UNO_QUERY );
|
Reference<XIdlArray> xIdlArray( mxIface, UNO_QUERY );
|
||||||
aGuard.reset();
|
aGuard.lock();
|
||||||
if( !mxObjIdlArray.is() )
|
if( !mxObjIdlArray.is() )
|
||||||
mxObjIdlArray = xIdlArray;
|
mxObjIdlArray = xIdlArray;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user