diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2021-07-18 14:46:09 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-07-19 12:38:02 +0200 |
commit | 739aaf02db3353fac8490272cab0c9486570f76d (patch) | |
tree | bf5f5a1b8ab81a02f696ed52d64051b7199c6abb /bridges | |
parent | 0067c3bd377bea366cd61cc06bba3b8d521401d4 (diff) |
osl::Mutex->std::mutex in bridges/except
I changed all the bridges to keep them in sync, but only
tested on the LibreOffice CI machines.
Change-Id: Id8fef017cc6c99c60d64b8f849220d5336abc5d5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119140
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'bridges')
20 files changed, 71 insertions, 62 deletions
diff --git a/bridges/source/cpp_uno/gcc3_aix_powerpc/except.cxx b/bridges/source/cpp_uno/gcc3_aix_powerpc/except.cxx index e87590592888..591a5c94742d 100644 --- a/bridges/source/cpp_uno/gcc3_aix_powerpc/except.cxx +++ b/bridges/source/cpp_uno/gcc3_aix_powerpc/except.cxx @@ -24,11 +24,11 @@ #include <rtl/strbuf.hxx> #include <rtl/ustrbuf.hxx> -#include <osl/mutex.hxx> #include <com/sun/star/uno/genfunc.hxx> #include <typelib/typedescription.hxx> #include <uno/any2.h> +#include <mutex> #include <unordered_map> #include "share.hxx" #include <string.h> @@ -90,8 +90,8 @@ class RTTI { typedef std::unordered_map< OUString, type_info * > t_rtti_map; - Mutex m_mutex; - t_rtti_map m_rttis; + std::mutex m_mutex; + t_rtti_map m_rttis; t_rtti_map m_generatedRttis; void * m_hApp; @@ -120,7 +120,7 @@ type_info * RTTI::getRTTI( typelib_CompoundTypeDescription *pTypeDescr ) OUString const & unoName = *(OUString const *)&pTypeDescr->aBase.pTypeName; - MutexGuard guard( m_mutex ); + std::lock_guard guard( m_mutex ); t_rtti_map::const_iterator iFind( m_rttis.find( unoName ) ); if (iFind == m_rttis.end()) { diff --git a/bridges/source/cpp_uno/gcc3_ios/except.cxx b/bridges/source/cpp_uno/gcc3_ios/except.cxx index d5c49859db27..30658b708e1a 100644 --- a/bridges/source/cpp_uno/gcc3_ios/except.cxx +++ b/bridges/source/cpp_uno/gcc3_ios/except.cxx @@ -31,11 +31,11 @@ #include "com/sun/star/uno/RuntimeException.hpp" #include "com/sun/star/uno/genfunc.hxx" #include <sal/log.hxx> -#include "osl/mutex.hxx" #include "rtl/strbuf.hxx" #include "rtl/ustrbuf.hxx" #include "typelib/typedescription.h" #include "uno/any2.h" +#include <mutex> #include <unordered_map> #include "share.hxx" @@ -145,7 +145,7 @@ class RTTI { typedef std::unordered_map< OUString, std::type_info *, OUStringHash > t_rtti_map; - Mutex m_mutex; + std::mutex m_mutex; t_rtti_map m_rttis; t_rtti_map m_generatedRttis; @@ -175,7 +175,7 @@ std::type_info * RTTI::getRTTI( typelib_CompoundTypeDescription *pTypeDescr ) OUString const & unoName = OUString::unacquired(&pTypeDescr->aBase.pTypeName); - MutexGuard guard( m_mutex ); + std::lock_guard guard( m_mutex ); t_rtti_map::const_iterator iFind( m_rttis.find( unoName ) ); if (iFind == m_rttis.end()) { diff --git a/bridges/source/cpp_uno/gcc3_linux_alpha/except.cxx b/bridges/source/cpp_uno/gcc3_linux_alpha/except.cxx index 9331665fab7f..762d6036c7e9 100644 --- a/bridges/source/cpp_uno/gcc3_linux_alpha/except.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_alpha/except.cxx @@ -24,11 +24,11 @@ #include <cxxabi.h> #include <rtl/strbuf.hxx> #include <rtl/ustrbuf.hxx> -#include <osl/mutex.hxx> #include <com/sun/star/uno/genfunc.hxx> #include <typelib/typedescription.hxx> #include <uno/any2.h> +#include <mutex> #include <unordered_map> #include "share.hxx" @@ -87,7 +87,7 @@ class RTTI { typedef std::unordered_map< OUString, type_info * > t_rtti_map; - Mutex m_mutex; + std::mutex m_mutex; t_rtti_map m_rttis; t_rtti_map m_generatedRttis; @@ -117,7 +117,7 @@ type_info * RTTI::getRTTI( typelib_CompoundTypeDescription *pTypeDescr ) OUString const & unoName = *(OUString const *)&pTypeDescr->aBase.pTypeName; - MutexGuard guard( m_mutex ); + std::lock_guard guard( m_mutex ); t_rtti_map::const_iterator iRttiFind( m_rttis.find( unoName ) ); if (iRttiFind == m_rttis.end()) { diff --git a/bridges/source/cpp_uno/gcc3_linux_arm/except.cxx b/bridges/source/cpp_uno/gcc3_linux_arm/except.cxx index 14bffa75ad7f..c4a1a860493e 100644 --- a/bridges/source/cpp_uno/gcc3_linux_arm/except.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_arm/except.cxx @@ -23,13 +23,13 @@ #include <cxxabi.h> #include <rtl/strbuf.hxx> #include <rtl/ustrbuf.hxx> -#include <osl/mutex.hxx> #include <sal/log.hxx> #include <com/sun/star/uno/genfunc.hxx> #include <com/sun/star/uno/RuntimeException.hpp> #include <typelib/typedescription.hxx> #include <uno/any2.h> +#include <mutex> #include <unordered_map> #include "share.hxx" @@ -90,7 +90,7 @@ namespace { { typedef std::unordered_map< OUString, type_info * > t_rtti_map; - Mutex m_mutex; + std::mutex m_mutex; t_rtti_map m_rttis; t_rtti_map m_generatedRttis; @@ -127,7 +127,7 @@ namespace { OUString const & unoName = *reinterpret_cast<OUString const *>(&pTypeDescr->aBase.pTypeName); - MutexGuard guard( m_mutex ); + std::lock_guard guard( m_mutex ); t_rtti_map::const_iterator iFind( m_rttis.find( unoName ) ); if (iFind == m_rttis.end()) { diff --git a/bridges/source/cpp_uno/gcc3_linux_hppa/except.cxx b/bridges/source/cpp_uno/gcc3_linux_hppa/except.cxx index b5339eb2b1b6..ec6ae56bf39c 100644 --- a/bridges/source/cpp_uno/gcc3_linux_hppa/except.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_hppa/except.cxx @@ -23,13 +23,13 @@ #include <cxxabi.h> #include <rtl/strbuf.hxx> #include <rtl/ustrbuf.hxx> -#include <osl/mutex.hxx> #include <sal/log.hxx> #include <com/sun/star/uno/genfunc.hxx> #include "com/sun/star/uno/RuntimeException.hpp" #include <typelib/typedescription.hxx> #include <uno/any2.h> +#include <mutex> #include <unordered_map> #include "share.hxx" @@ -89,7 +89,7 @@ namespace CPPU_CURRENT_NAMESPACE { typedef std::unordered_map< OUString, type_info * > t_rtti_map; - Mutex m_mutex; + std::mutex m_mutex; t_rtti_map m_rttis; t_rtti_map m_generatedRttis; @@ -119,7 +119,7 @@ namespace CPPU_CURRENT_NAMESPACE OUString const & unoName = *(OUString const *)&pTypeDescr->aBase.pTypeName; - MutexGuard guard( m_mutex ); + std::lock_guard guard( m_mutex ); t_rtti_map::const_iterator iRttiFind( m_rttis.find( unoName ) ); if (iRttiFind == m_rttis.end()) { diff --git a/bridges/source/cpp_uno/gcc3_linux_ia64/except.cxx b/bridges/source/cpp_uno/gcc3_linux_ia64/except.cxx index 1241aa02e1eb..7b56a88a0115 100644 --- a/bridges/source/cpp_uno/gcc3_linux_ia64/except.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_ia64/except.cxx @@ -24,11 +24,11 @@ #include <cxxabi.h> #include <rtl/strbuf.hxx> #include <rtl/ustrbuf.hxx> -#include <osl/mutex.hxx> #include <com/sun/star/uno/genfunc.hxx> #include <typelib/typedescription.hxx> #include <uno/any2.h> +#include <mutex> #include <unordered_map> #include "share.hxx" @@ -87,7 +87,7 @@ class RTTI { typedef std::unordered_map< OUString, type_info * > t_rtti_map; - Mutex m_mutex; + std::mutex m_mutex; t_rtti_map m_rttis; t_rtti_map m_generatedRttis; @@ -117,7 +117,7 @@ type_info * RTTI::getRTTI( typelib_CompoundTypeDescription *pTypeDescr ) OUString const & unoName = *(OUString const *)&pTypeDescr->aBase.pTypeName; - MutexGuard guard( m_mutex ); + std::lock_guard guard( m_mutex ); t_rtti_map::const_iterator iRttiFind( m_rttis.find( unoName ) ); if (iRttiFind == m_rttis.end()) { diff --git a/bridges/source/cpp_uno/gcc3_linux_intel/except.cxx b/bridges/source/cpp_uno/gcc3_linux_intel/except.cxx index 79a37803b3c7..da870f5a48d3 100644 --- a/bridges/source/cpp_uno/gcc3_linux_intel/except.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_intel/except.cxx @@ -23,12 +23,12 @@ #include <rtl/strbuf.hxx> #include <rtl/ustrbuf.hxx> -#include <osl/mutex.hxx> #include <sal/log.hxx> #include <com/sun/star/uno/genfunc.hxx> #include <com/sun/star/uno/RuntimeException.hpp> #include <typelib/typedescription.hxx> +#include <mutex> #include <unordered_map> #include "share.hxx" @@ -86,7 +86,7 @@ class RTTI { typedef std::unordered_map< OUString, type_info * > t_rtti_map; - Mutex m_mutex; + std::mutex m_mutex; t_rtti_map m_rttis; t_rtti_map m_generatedRttis; @@ -122,7 +122,7 @@ type_info * RTTI::getRTTI( typelib_CompoundTypeDescription *pTypeDescr ) OUString const & unoName = OUString::unacquired(&pTypeDescr->aBase.pTypeName); - MutexGuard guard( m_mutex ); + std::lock_guard guard( m_mutex ); t_rtti_map::const_iterator iRttiFind( m_rttis.find( unoName ) ); if (iRttiFind == m_rttis.end()) { diff --git a/bridges/source/cpp_uno/gcc3_linux_m68k/except.cxx b/bridges/source/cpp_uno/gcc3_linux_m68k/except.cxx index 047022f245c0..2b8a9ab5d792 100644 --- a/bridges/source/cpp_uno/gcc3_linux_m68k/except.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_m68k/except.cxx @@ -24,12 +24,12 @@ #include <rtl/strbuf.hxx> #include <rtl/ustrbuf.hxx> #include <sal/log.hxx> -#include <osl/mutex.hxx> #include <com/sun/star/uno/genfunc.hxx> #include "com/sun/star/uno/RuntimeException.hpp" #include <typelib/typedescription.hxx> #include <uno/any2.h> +#include <mutex> #include <unordered_map> #include "share.hxx" @@ -89,7 +89,7 @@ namespace CPPU_CURRENT_NAMESPACE { typedef std::unordered_map< OUString, type_info * > t_rtti_map; - Mutex m_mutex; + std::mutex m_mutex; t_rtti_map m_rttis; t_rtti_map m_generatedRttis; @@ -119,7 +119,7 @@ namespace CPPU_CURRENT_NAMESPACE OUString const & unoName = *(OUString const *)&pTypeDescr->aBase.pTypeName; - MutexGuard guard( m_mutex ); + std::lock_guard guard( m_mutex ); t_rtti_map::const_iterator iRttiFind( m_rttis.find( unoName ) ); if (iRttiFind == m_rttis.end()) { diff --git a/bridges/source/cpp_uno/gcc3_linux_mips/except.cxx b/bridges/source/cpp_uno/gcc3_linux_mips/except.cxx index 68e4e25f691d..481b91a4fab3 100644 --- a/bridges/source/cpp_uno/gcc3_linux_mips/except.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_mips/except.cxx @@ -23,11 +23,11 @@ #include <rtl/strbuf.hxx> #include <rtl/ustrbuf.hxx> #include <sal/log.hxx> -#include <osl/mutex.hxx> #include <com/sun/star/uno/genfunc.hxx> #include <typelib/typedescription.hxx> #include <uno/any2.h> +#include <mutex> #include <unordered_map> #include "share.hxx" @@ -86,7 +86,7 @@ class RTTI { typedef std::unordered_map< OUString, type_info * > t_rtti_map; - Mutex m_mutex; + std::mutex m_mutex; t_rtti_map m_rttis; t_rtti_map m_generatedRttis; @@ -116,7 +116,7 @@ type_info * RTTI::getRTTI( typelib_CompoundTypeDescription *pTypeDescr ) OUString const & unoName = *(OUString const *)&pTypeDescr->aBase.pTypeName; - MutexGuard guard( m_mutex ); + std::lock_guard guard( m_mutex ); t_rtti_map::const_iterator iRttiFind( m_rttis.find( unoName ) ); if (iRttiFind == m_rttis.end()) { diff --git a/bridges/source/cpp_uno/gcc3_linux_mips64/except.cxx b/bridges/source/cpp_uno/gcc3_linux_mips64/except.cxx index ca94243d06fe..dfe2c501090a 100644 --- a/bridges/source/cpp_uno/gcc3_linux_mips64/except.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_mips64/except.cxx @@ -23,12 +23,12 @@ #include <rtl/strbuf.hxx> #include <rtl/ustrbuf.hxx> #include <sal/log.hxx> -#include <osl/mutex.hxx> #include <com/sun/star/uno/genfunc.hxx> #include <typelib/typedescription.hxx> #include <uno/any2.h> +#include <mutex> #include <unordered_map> #include "share.hxx" @@ -87,7 +87,7 @@ class RTTI { typedef std::unordered_map< OUString, type_info * > t_rtti_map; - Mutex m_mutex; + std::mutex m_mutex; t_rtti_map m_rttis; t_rtti_map m_generatedRttis; @@ -117,7 +117,7 @@ type_info * RTTI::getRTTI( typelib_CompoundTypeDescription *pTypeDescr ) OUString const & unoName = *(OUString const *)&pTypeDescr->aBase.pTypeName; - MutexGuard guard( m_mutex ); + std::lock_guard guard( m_mutex ); t_rtti_map::const_iterator iRttiFind( m_rttis.find( unoName ) ); if (iRttiFind == m_rttis.end()) { diff --git a/bridges/source/cpp_uno/gcc3_linux_powerpc/except.cxx b/bridges/source/cpp_uno/gcc3_linux_powerpc/except.cxx index ec26bc4969ee..187e1ef8615f 100644 --- a/bridges/source/cpp_uno/gcc3_linux_powerpc/except.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_powerpc/except.cxx @@ -25,11 +25,11 @@ #include <rtl/strbuf.hxx> #include <rtl/ustrbuf.hxx> -#include <osl/mutex.hxx> #include <com/sun/star/uno/genfunc.hxx> #include <typelib/typedescription.hxx> #include <uno/any2.h> +#include <mutex> #include <unordered_map> #include "share.hxx" @@ -87,7 +87,7 @@ class RTTI { typedef std::unordered_map< OUString, type_info * > t_rtti_map; - Mutex m_mutex; + std::mutex m_mutex; t_rtti_map m_rttis; t_rtti_map m_generatedRttis; @@ -117,7 +117,7 @@ type_info * RTTI::getRTTI( typelib_CompoundTypeDescription *pTypeDescr ) OUString const & unoName = *(OUString const *)&pTypeDescr->aBase.pTypeName; - MutexGuard guard( m_mutex ); + std::lock_guard guard( m_mutex ); t_rtti_map::const_iterator iRttiFind( m_rttis.find( unoName ) ); if (iRttiFind == m_rttis.end()) { diff --git a/bridges/source/cpp_uno/gcc3_linux_powerpc64/except.cxx b/bridges/source/cpp_uno/gcc3_linux_powerpc64/except.cxx index 1241aa02e1eb..7b56a88a0115 100644 --- a/bridges/source/cpp_uno/gcc3_linux_powerpc64/except.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_powerpc64/except.cxx @@ -24,11 +24,11 @@ #include <cxxabi.h> #include <rtl/strbuf.hxx> #include <rtl/ustrbuf.hxx> -#include <osl/mutex.hxx> #include <com/sun/star/uno/genfunc.hxx> #include <typelib/typedescription.hxx> #include <uno/any2.h> +#include <mutex> #include <unordered_map> #include "share.hxx" @@ -87,7 +87,7 @@ class RTTI { typedef std::unordered_map< OUString, type_info * > t_rtti_map; - Mutex m_mutex; + std::mutex m_mutex; t_rtti_map m_rttis; t_rtti_map m_generatedRttis; @@ -117,7 +117,7 @@ type_info * RTTI::getRTTI( typelib_CompoundTypeDescription *pTypeDescr ) OUString const & unoName = *(OUString const *)&pTypeDescr->aBase.pTypeName; - MutexGuard guard( m_mutex ); + std::lock_guard guard( m_mutex ); t_rtti_map::const_iterator iRttiFind( m_rttis.find( unoName ) ); if (iRttiFind == m_rttis.end()) { diff --git a/bridges/source/cpp_uno/gcc3_linux_s390/except.cxx b/bridges/source/cpp_uno/gcc3_linux_s390/except.cxx index 9331665fab7f..762d6036c7e9 100644 --- a/bridges/source/cpp_uno/gcc3_linux_s390/except.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_s390/except.cxx @@ -24,11 +24,11 @@ #include <cxxabi.h> #include <rtl/strbuf.hxx> #include <rtl/ustrbuf.hxx> -#include <osl/mutex.hxx> #include <com/sun/star/uno/genfunc.hxx> #include <typelib/typedescription.hxx> #include <uno/any2.h> +#include <mutex> #include <unordered_map> #include "share.hxx" @@ -87,7 +87,7 @@ class RTTI { typedef std::unordered_map< OUString, type_info * > t_rtti_map; - Mutex m_mutex; + std::mutex m_mutex; t_rtti_map m_rttis; t_rtti_map m_generatedRttis; @@ -117,7 +117,7 @@ type_info * RTTI::getRTTI( typelib_CompoundTypeDescription *pTypeDescr ) OUString const & unoName = *(OUString const *)&pTypeDescr->aBase.pTypeName; - MutexGuard guard( m_mutex ); + std::lock_guard guard( m_mutex ); t_rtti_map::const_iterator iRttiFind( m_rttis.find( unoName ) ); if (iRttiFind == m_rttis.end()) { diff --git a/bridges/source/cpp_uno/gcc3_linux_s390x/except.cxx b/bridges/source/cpp_uno/gcc3_linux_s390x/except.cxx index 386069b9fb31..4dac74559a8d 100644 --- a/bridges/source/cpp_uno/gcc3_linux_s390x/except.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_s390x/except.cxx @@ -24,11 +24,11 @@ #include <cxxabi.h> #include <rtl/strbuf.hxx> #include <rtl/ustrbuf.hxx> -#include <osl/mutex.hxx> #include <com/sun/star/uno/genfunc.hxx> #include <typelib/typedescription.hxx> #include <uno/any2.h> +#include <mutex> #include <unordered_map> #include "share.hxx" @@ -87,7 +87,7 @@ class RTTI { typedef std::unordered_map< OUString, type_info * > t_rtti_map; - Mutex m_mutex; + std::mutex m_mutex; t_rtti_map m_rttis; t_rtti_map m_generatedRttis; @@ -117,7 +117,7 @@ type_info * RTTI::getRTTI( typelib_CompoundTypeDescription *pTypeDescr ) OUString const & unoName = *(OUString const *)&pTypeDescr->aBase.pTypeName; - MutexGuard guard( m_mutex ); + std::lock_guard guard( m_mutex ); t_rtti_map::const_iterator iRttiFind( m_rttis.find( unoName ) ); if (iRttiFind == m_rttis.end()) { diff --git a/bridges/source/cpp_uno/gcc3_linux_sparc/except.cxx b/bridges/source/cpp_uno/gcc3_linux_sparc/except.cxx index a87eeac162db..9eaedb8f0566 100644 --- a/bridges/source/cpp_uno/gcc3_linux_sparc/except.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_sparc/except.cxx @@ -24,11 +24,11 @@ #include <rtl/strbuf.hxx> #include <rtl/ustrbuf.hxx> #include <sal/log.hxx> -#include <osl/mutex.hxx> #include <com/sun/star/uno/genfunc.hxx> #include <typelib/typedescription.hxx> #include <uno/any2.h> +#include <mutex> #include <unordered_map> #include "share.hxx" @@ -87,7 +87,7 @@ class RTTI { typedef std::unordered_map< OUString, type_info * > t_rtti_map; - Mutex m_mutex; + std::mutex m_mutex; t_rtti_map m_rttis; t_rtti_map m_generatedRttis; @@ -117,7 +117,7 @@ type_info * RTTI::getRTTI( typelib_CompoundTypeDescription *pTypeDescr ) OUString const & unoName = *(OUString const *)&pTypeDescr->aBase.pTypeName; - MutexGuard guard( m_mutex ); + std::lock_guard guard( m_mutex ); t_rtti_map::const_iterator iFind( m_rttis.find( unoName ) ); if (iFind == m_rttis.end()) { diff --git a/bridges/source/cpp_uno/gcc3_linux_sparc64/except.cxx b/bridges/source/cpp_uno/gcc3_linux_sparc64/except.cxx index a87eeac162db..9eaedb8f0566 100644 --- a/bridges/source/cpp_uno/gcc3_linux_sparc64/except.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_sparc64/except.cxx @@ -24,11 +24,11 @@ #include <rtl/strbuf.hxx> #include <rtl/ustrbuf.hxx> #include <sal/log.hxx> -#include <osl/mutex.hxx> #include <com/sun/star/uno/genfunc.hxx> #include <typelib/typedescription.hxx> #include <uno/any2.h> +#include <mutex> #include <unordered_map> #include "share.hxx" @@ -87,7 +87,7 @@ class RTTI { typedef std::unordered_map< OUString, type_info * > t_rtti_map; - Mutex m_mutex; + std::mutex m_mutex; t_rtti_map m_rttis; t_rtti_map m_generatedRttis; @@ -117,7 +117,7 @@ type_info * RTTI::getRTTI( typelib_CompoundTypeDescription *pTypeDescr ) OUString const & unoName = *(OUString const *)&pTypeDescr->aBase.pTypeName; - MutexGuard guard( m_mutex ); + std::lock_guard guard( m_mutex ); t_rtti_map::const_iterator iFind( m_rttis.find( unoName ) ); if (iFind == m_rttis.end()) { diff --git a/bridges/source/cpp_uno/gcc3_linux_x86-64/rtti.cxx b/bridges/source/cpp_uno/gcc3_linux_x86-64/rtti.cxx index 2e11b6eb42bc..839c25755098 100644 --- a/bridges/source/cpp_uno/gcc3_linux_x86-64/rtti.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_x86-64/rtti.cxx @@ -21,6 +21,7 @@ #include <cassert> #include <memory> +#include <mutex> #include <typeinfo> #include <unordered_map> #include <utility> @@ -75,7 +76,7 @@ class RTTI { typedef std::unordered_map< OUString, std::type_info * > t_rtti_map; - osl::Mutex m_mutex; + std::mutex m_mutex; t_rtti_map m_rttis; std::vector<OString> m_rttiNames; std::unordered_map<OUString, std::unique_ptr<Generated>> m_generatedRttis; @@ -89,6 +90,9 @@ public: ~RTTI(); std::type_info * getRTTI(typelib_TypeDescription const &); + +private: + std::type_info * getRTTI_NoLock(typelib_TypeDescription const &); }; RTTI::RTTI() @@ -107,11 +111,16 @@ RTTI::~RTTI() std::type_info * RTTI::getRTTI(typelib_TypeDescription const & pTypeDescr) { + std::lock_guard guard( m_mutex ); + return getRTTI_NoLock(pTypeDescr); +} + +std::type_info * RTTI::getRTTI_NoLock(typelib_TypeDescription const & pTypeDescr) +{ std::type_info * rtti; OUString const & unoName = OUString::unacquired(&pTypeDescr.pTypeName); - osl::MutexGuard guard( m_mutex ); t_rtti_map::const_iterator iFind( m_rttis.find( unoName ) ); if (iFind == m_rttis.end()) { @@ -166,7 +175,7 @@ std::type_info * RTTI::getRTTI(typelib_TypeDescription const & pTypeDescr) if (ctd.pBaseTypeDescription) { // ensure availability of base - std::type_info * base_rtti = getRTTI( + std::type_info * base_rtti = getRTTI_NoLock( ctd.pBaseTypeDescription->aBase); m_rttiNames.emplace_back(OString(rttiName)); std::unique_ptr<std::type_info> info( @@ -192,7 +201,7 @@ std::type_info * RTTI::getRTTI(typelib_TypeDescription const & pTypeDescr) pTypeDescr); std::vector<std::type_info *> bases; for (sal_Int32 i = 0; i != itd.nBaseTypes; ++i) { - bases.push_back(getRTTI(itd.ppBaseTypes[i]->aBase)); + bases.push_back(getRTTI_NoLock(itd.ppBaseTypes[i]->aBase)); } switch (itd.nBaseTypes) { case 0: diff --git a/bridges/source/cpp_uno/gcc3_macosx_x86-64/except.cxx b/bridges/source/cpp_uno/gcc3_macosx_x86-64/except.cxx index 60f5f6e40ef1..4a186805e0f0 100644 --- a/bridges/source/cpp_uno/gcc3_macosx_x86-64/except.cxx +++ b/bridges/source/cpp_uno/gcc3_macosx_x86-64/except.cxx @@ -31,11 +31,11 @@ #include <com/sun/star/uno/RuntimeException.hpp> #include <com/sun/star/uno/genfunc.hxx> #include <sal/log.hxx> -#include <osl/mutex.hxx> #include <rtl/strbuf.hxx> #include <rtl/ustrbuf.hxx> #include <typelib/typedescription.h> #include <uno/any2.h> +#include <mutex> #include <unordered_map> #include "share.hxx" @@ -147,7 +147,7 @@ class RTTI { typedef std::unordered_map< OUString, std::type_info * > t_rtti_map; - Mutex m_mutex; + std::mutex m_mutex; t_rtti_map m_rttis; t_rtti_map m_generatedRttis; @@ -179,7 +179,7 @@ std::type_info * RTTI::getRTTI( typelib_CompoundTypeDescription *pTypeDescr ) OUString const & unoName = OUString::unacquired(&pTypeDescr->aBase.pTypeName); - MutexGuard guard( m_mutex ); + std::lock_guard guard( m_mutex ); t_rtti_map::const_iterator iFind( m_rttis.find( unoName ) ); if (iFind == m_rttis.end()) { diff --git a/bridges/source/cpp_uno/gcc3_solaris_intel/except.cxx b/bridges/source/cpp_uno/gcc3_solaris_intel/except.cxx index 1eb183aa7c1f..0c1e3876b193 100644 --- a/bridges/source/cpp_uno/gcc3_solaris_intel/except.cxx +++ b/bridges/source/cpp_uno/gcc3_solaris_intel/except.cxx @@ -25,12 +25,12 @@ #include <rtl/strbuf.hxx> #include <rtl/ustrbuf.hxx> #include <sal/log.hxx> -#include <osl/mutex.hxx> #include <com/sun/star/uno/genfunc.hxx> #include "com/sun/star/uno/RuntimeException.hpp" #include <typelib/typedescription.hxx> #include <uno/any2.h> +#include <mutex> #include <unordered_map> #include "share.hxx" @@ -89,7 +89,7 @@ class RTTI { typedef std::unordered_map< OUString, type_info * > t_rtti_map; - Mutex m_mutex; + std::mutex m_mutex; t_rtti_map m_rttis; t_rtti_map m_generatedRttis; @@ -119,7 +119,7 @@ type_info * RTTI::getRTTI( typelib_CompoundTypeDescription *pTypeDescr ) OUString const & unoName = *(OUString const *)&pTypeDescr->aBase.pTypeName; - MutexGuard guard( m_mutex ); + std::lock_guard guard( m_mutex ); t_rtti_map::const_iterator iFind( m_rttis.find( unoName ) ); if (iFind == m_rttis.end()) { diff --git a/bridges/source/cpp_uno/gcc3_solaris_sparc/except.cxx b/bridges/source/cpp_uno/gcc3_solaris_sparc/except.cxx index 752b03e619f5..831fecc23eb3 100644 --- a/bridges/source/cpp_uno/gcc3_solaris_sparc/except.cxx +++ b/bridges/source/cpp_uno/gcc3_solaris_sparc/except.cxx @@ -23,11 +23,11 @@ #include <rtl/strbuf.hxx> #include <rtl/ustrbuf.hxx> #include <sal/log.hxx> -#include <osl/mutex.hxx> #include <com/sun/star/uno/genfunc.hxx> #include <typelib/typedescription.hxx> #include <uno/any2.h> +#include <mutex> #include <unordered_map> #include "share.hxx" @@ -86,7 +86,7 @@ class RTTI { typedef std::unordered_map< OUString, type_info * > t_rtti_map; - Mutex m_mutex; + std::mutex m_mutex; t_rtti_map m_rttis; t_rtti_map m_generatedRttis; @@ -116,7 +116,7 @@ type_info * RTTI::getRTTI( typelib_CompoundTypeDescription *pTypeDescr ) OUString const & unoName = *(OUString const *)&pTypeDescr->aBase.pTypeName; - MutexGuard guard( m_mutex ); + std::lock_guard guard( m_mutex ); t_rtti_map::const_iterator iFind( m_rttis.find( unoName ) ); if (iFind == m_rttis.end()) { |