diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2021-07-27 09:57:16 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2021-07-27 13:38:40 +0200 |
commit | b4a46b47b6c1eab5c293648f5d89e61dd4639213 (patch) | |
tree | 667392a2e84e577c30d3d018372fb1cd92302349 /bridges | |
parent | 0aea34da123edc8e1be8626769f0ab83b6d0cab8 (diff) |
Revert "osl::Mutex->std::mutex in bridges/except"
This reverts commit 739aaf02db3353fac8490272cab0c9486570f76d. At least in
bridges/source/cpp_uno/gcc3_macosx_x86-64/except.cxx, getRTTI can call itself
recursively, causing a deadlock on RTTI::m_mutex. In
bridges/source/cpp_uno/gcc3_linux_x86-64/rtti.cxx that has been addressed with
RTTI::getRTTI_NoLock, but other implementations have not been modified. Avoid
regressions, esp. on more esoteric platforms, by reverting the change.
Conflicts:
bridges/source/cpp_uno/gcc3_linux_x86-64/rtti.cxx
Change-Id: I08b57b0561923bdbe191c8e93f8f400e0e4df337
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119442
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'bridges')
20 files changed, 62 insertions, 71 deletions
diff --git a/bridges/source/cpp_uno/gcc3_aix_powerpc/except.cxx b/bridges/source/cpp_uno/gcc3_aix_powerpc/except.cxx index 591a5c94742d..e87590592888 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; - std::mutex m_mutex; - t_rtti_map m_rttis; + 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; - std::lock_guard guard( m_mutex ); + MutexGuard 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 30658b708e1a..d5c49859db27 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; - std::mutex m_mutex; + 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); - std::lock_guard guard( m_mutex ); + MutexGuard 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 762d6036c7e9..9331665fab7f 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; - std::mutex m_mutex; + 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; - std::lock_guard guard( m_mutex ); + MutexGuard 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 c4a1a860493e..14bffa75ad7f 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; - std::mutex m_mutex; + 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); - std::lock_guard guard( m_mutex ); + MutexGuard 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 ec6ae56bf39c..b5339eb2b1b6 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; - std::mutex m_mutex; + 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; - std::lock_guard guard( m_mutex ); + MutexGuard 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 7b56a88a0115..1241aa02e1eb 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; - std::mutex m_mutex; + 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; - std::lock_guard guard( m_mutex ); + MutexGuard 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 da870f5a48d3..79a37803b3c7 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; - std::mutex m_mutex; + 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); - std::lock_guard guard( m_mutex ); + MutexGuard 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 2b8a9ab5d792..047022f245c0 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; - std::mutex m_mutex; + 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; - std::lock_guard guard( m_mutex ); + MutexGuard 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 481b91a4fab3..68e4e25f691d 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; - std::mutex m_mutex; + 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; - std::lock_guard guard( m_mutex ); + MutexGuard 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 dfe2c501090a..ca94243d06fe 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; - std::mutex m_mutex; + 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; - std::lock_guard guard( m_mutex ); + MutexGuard 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 187e1ef8615f..ec26bc4969ee 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; - std::mutex m_mutex; + 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; - std::lock_guard guard( m_mutex ); + MutexGuard 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 7b56a88a0115..1241aa02e1eb 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; - std::mutex m_mutex; + 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; - std::lock_guard guard( m_mutex ); + MutexGuard 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 762d6036c7e9..9331665fab7f 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; - std::mutex m_mutex; + 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; - std::lock_guard guard( m_mutex ); + MutexGuard 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 4dac74559a8d..386069b9fb31 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; - std::mutex m_mutex; + 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; - std::lock_guard guard( m_mutex ); + MutexGuard 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 9eaedb8f0566..a87eeac162db 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; - std::mutex m_mutex; + 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; - std::lock_guard guard( m_mutex ); + MutexGuard 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 9eaedb8f0566..a87eeac162db 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; - std::mutex m_mutex; + 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; - std::lock_guard guard( m_mutex ); + MutexGuard 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 30201a1739e3..322656c126e5 100644 --- a/bridges/source/cpp_uno/gcc3_linux_x86-64/rtti.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_x86-64/rtti.cxx @@ -21,7 +21,6 @@ #include <cassert> #include <memory> -#include <mutex> #include <typeinfo> #include <unordered_map> #include <utility> @@ -76,7 +75,7 @@ class RTTI { typedef std::unordered_map< OUString, std::type_info * > t_rtti_map; - std::mutex m_mutex; + osl::Mutex m_mutex; t_rtti_map m_rttis; std::vector<OString> m_rttiNames; std::unordered_map<OUString, std::unique_ptr<Generated>> m_generatedRttis; @@ -90,9 +89,6 @@ public: ~RTTI(); std::type_info * getRTTI(typelib_TypeDescription const &); - -private: - std::type_info * getRTTI_NoLock(typelib_TypeDescription const &); }; RTTI::RTTI() @@ -111,14 +107,9 @@ 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) -{ 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()) return iFind->second; @@ -181,7 +172,7 @@ std::type_info * RTTI::getRTTI_NoLock(typelib_TypeDescription const & pTypeDescr if (ctd.pBaseTypeDescription) { // ensure availability of base - std::type_info * base_rtti = getRTTI_NoLock( + std::type_info * base_rtti = getRTTI( ctd.pBaseTypeDescription->aBase); m_rttiNames.emplace_back(OString(rttiName)); std::unique_ptr<std::type_info> info( @@ -207,7 +198,7 @@ std::type_info * RTTI::getRTTI_NoLock(typelib_TypeDescription const & pTypeDescr pTypeDescr); std::vector<std::type_info *> bases; for (sal_Int32 i = 0; i != itd.nBaseTypes; ++i) { - bases.push_back(getRTTI_NoLock(itd.ppBaseTypes[i]->aBase)); + bases.push_back(getRTTI(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 4a186805e0f0..60f5f6e40ef1 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; - std::mutex m_mutex; + 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); - std::lock_guard guard( m_mutex ); + MutexGuard 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 0c1e3876b193..1eb183aa7c1f 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; - std::mutex m_mutex; + 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; - std::lock_guard guard( m_mutex ); + MutexGuard 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 831fecc23eb3..752b03e619f5 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; - std::mutex m_mutex; + 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; - std::lock_guard guard( m_mutex ); + MutexGuard guard( m_mutex ); t_rtti_map::const_iterator iFind( m_rttis.find( unoName ) ); if (iFind == m_rttis.end()) { |