diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2021-12-20 20:24:01 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-01-03 20:07:29 +0100 |
commit | c87c58feb2e4be996ae28a6bc393fc86cde18598 (patch) | |
tree | 0b13b4f6a05fc3b87cffb360f6e46a97c9b16305 /stoc | |
parent | 527e33784ab35c57e997024f6322aebd909bcf59 (diff) |
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>
Diffstat (limited to 'stoc')
-rw-r--r-- | stoc/source/inspect/introspection.cxx | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/stoc/source/inspect/introspection.cxx b/stoc/source/inspect/introspection.cxx index aa1440bb4b7d..0b27ac0b1fe3 100644 --- a/stoc/source/inspect/introspection.cxx +++ b/stoc/source/inspect/introspection.cxx @@ -24,11 +24,11 @@ #include <limits> #include <map> #include <memory> +#include <mutex> #include <set> #include <o3tl/any.hxx> #include <osl/diagnose.h> -#include <osl/mutex.hxx> #include <sal/log.hxx> #include <cppuhelper/basemutex.hxx> #include <cppuhelper/compbase.hxx> @@ -660,7 +660,7 @@ class ImplIntrospectionAccess : public IntrospectionAccessHelper sal_Int32 mnLastMethodConcept; // Guards the caching of queried interfaces - osl::Mutex m_aMutex; + std::mutex m_aMutex; // Original interfaces of the objects Reference<XElementAccess> mxObjElementAccess; @@ -782,13 +782,13 @@ ImplIntrospectionAccess::ImplIntrospectionAccess Reference<XElementAccess> ImplIntrospectionAccess::getXElementAccess() { - ResettableGuard< Mutex > aGuard( m_aMutex ); + std::unique_lock aGuard( m_aMutex ); if( !mxObjElementAccess.is() ) { - aGuard.clear(); + aGuard.unlock(); Reference<XElementAccess> xElementAccess( mxIface, UNO_QUERY ); - aGuard.reset(); + aGuard.lock(); if( !mxObjElementAccess.is() ) mxObjElementAccess = xElementAccess; } @@ -817,7 +817,7 @@ void ImplIntrospectionAccess::cacheXNameContainer() } { - MutexGuard aGuard( m_aMutex ); + std::unique_lock aGuard( m_aMutex ); if( !mxObjNameContainer.is() ) mxObjNameContainer = xNameContainer; if( !mxObjNameReplace.is() ) @@ -829,11 +829,11 @@ void ImplIntrospectionAccess::cacheXNameContainer() Reference<XNameContainer> ImplIntrospectionAccess::getXNameContainer() { - ClearableGuard< Mutex > aGuard( m_aMutex ); + std::unique_lock aGuard( m_aMutex ); if( !mxObjNameContainer.is() ) { - aGuard.clear(); + aGuard.unlock(); cacheXNameContainer(); } return mxObjNameContainer; @@ -841,11 +841,11 @@ Reference<XNameContainer> ImplIntrospectionAccess::getXNameContainer() Reference<XNameReplace> ImplIntrospectionAccess::getXNameReplace() { - ClearableGuard< Mutex > aGuard( m_aMutex ); + std::unique_lock aGuard( m_aMutex ); if( !mxObjNameReplace.is() ) { - aGuard.clear(); + aGuard.unlock(); cacheXNameContainer(); } return mxObjNameReplace; @@ -853,11 +853,11 @@ Reference<XNameReplace> ImplIntrospectionAccess::getXNameReplace() Reference<XNameAccess> ImplIntrospectionAccess::getXNameAccess() { - ClearableGuard< Mutex > aGuard( m_aMutex ); + std::unique_lock aGuard( m_aMutex ); if( !mxObjNameAccess.is() ) { - aGuard.clear(); + aGuard.unlock(); cacheXNameContainer(); } return mxObjNameAccess; @@ -885,7 +885,7 @@ void ImplIntrospectionAccess::cacheXIndexContainer() } { - MutexGuard aGuard( m_aMutex ); + std::unique_lock aGuard( m_aMutex ); if( !mxObjIndexContainer.is() ) mxObjIndexContainer = xIndexContainer; if( !mxObjIndexReplace.is() ) @@ -897,11 +897,11 @@ void ImplIntrospectionAccess::cacheXIndexContainer() Reference<XIndexContainer> ImplIntrospectionAccess::getXIndexContainer() { - ClearableGuard< Mutex > aGuard( m_aMutex ); + std::unique_lock aGuard( m_aMutex ); if( !mxObjIndexContainer.is() ) { - aGuard.clear(); + aGuard.unlock(); cacheXIndexContainer(); } return mxObjIndexContainer; @@ -909,11 +909,11 @@ Reference<XIndexContainer> ImplIntrospectionAccess::getXIndexContainer() Reference<XIndexReplace> ImplIntrospectionAccess::getXIndexReplace() { - ClearableGuard< Mutex > aGuard( m_aMutex ); + std::unique_lock aGuard( m_aMutex ); if( !mxObjIndexReplace.is() ) { - aGuard.clear(); + aGuard.unlock(); cacheXIndexContainer(); } return mxObjIndexReplace; @@ -921,11 +921,11 @@ Reference<XIndexReplace> ImplIntrospectionAccess::getXIndexReplace() Reference<XIndexAccess> ImplIntrospectionAccess::getXIndexAccess() { - ClearableGuard< Mutex > aGuard( m_aMutex ); + std::unique_lock aGuard( m_aMutex ); if( !mxObjIndexAccess.is() ) { - aGuard.clear(); + aGuard.unlock(); cacheXIndexContainer(); } return mxObjIndexAccess; @@ -933,13 +933,13 @@ Reference<XIndexAccess> ImplIntrospectionAccess::getXIndexAccess() Reference<XEnumerationAccess> ImplIntrospectionAccess::getXEnumerationAccess() { - ResettableGuard< Mutex > aGuard( m_aMutex ); + std::unique_lock aGuard( m_aMutex ); if( !mxObjEnumerationAccess.is() ) { - aGuard.clear(); + aGuard.unlock(); Reference<XEnumerationAccess> xEnumerationAccess( mxIface, UNO_QUERY ); - aGuard.reset(); + aGuard.lock(); if( !mxObjEnumerationAccess.is() ) mxObjEnumerationAccess = xEnumerationAccess; } @@ -948,13 +948,13 @@ Reference<XEnumerationAccess> ImplIntrospectionAccess::getXEnumerationAccess() Reference<XIdlArray> ImplIntrospectionAccess::getXIdlArray() { - ResettableGuard< Mutex > aGuard( m_aMutex ); + std::unique_lock aGuard( m_aMutex ); if( !mxObjIdlArray.is() ) { - aGuard.clear(); + aGuard.unlock(); Reference<XIdlArray> xIdlArray( mxIface, UNO_QUERY ); - aGuard.reset(); + aGuard.lock(); if( !mxObjIdlArray.is() ) mxObjIdlArray = xIdlArray; } |