summaryrefslogtreecommitdiff
path: root/bridges
diff options
context:
space:
mode:
authorArnaud VERSINI <arnaud.versini@pm.me>2021-12-19 12:34:40 +0100
committerStephan Bergmann <sbergman@redhat.com>2021-12-20 14:14:44 +0100
commit587c530d13a5427ea6610d68d3db3fde27f50725 (patch)
treed11c070798e35851f183e05112e50effc2df8ced /bridges
parentd53b9c69e24d699a50497a1938dacf40e1682fc3 (diff)
bridges : use std mutex instead of osl::Mutex.
The lock_guard moved from RTTI::GetRTTI to x86_64::getRtti to avoid recursive lock. Change-Id: I0e71581dd57a4fb2655d4b9040fb9d943f73ab9e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127095 Reviewed-by: Stephan Bergmann <sbergman@redhat.com> Tested-by: Jenkins
Diffstat (limited to 'bridges')
-rw-r--r--bridges/source/cpp_uno/gcc3_linux_x86-64/rtti.cxx6
1 files changed, 3 insertions, 3 deletions
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 6e022515b2d7..242e2a476e23 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>
@@ -28,7 +29,6 @@
#include <dlfcn.h>
-#include <osl/mutex.hxx>
#include <rtl/strbuf.hxx>
#include <rtl/ustring.hxx>
#include <sal/log.hxx>
@@ -74,7 +74,6 @@ class RTTI
{
typedef std::unordered_map< OUString, std::type_info * > t_rtti_map;
- osl::Mutex m_mutex;
t_rtti_map m_rttis;
std::vector<OString> m_rttiNames;
std::unordered_map<OUString, std::unique_ptr<Generated>> m_generatedRttis;
@@ -108,7 +107,6 @@ std::type_info * RTTI::getRTTI(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;
@@ -268,6 +266,8 @@ std::type_info * RTTI::getRTTI(typelib_TypeDescription const & pTypeDescr)
std::type_info * x86_64::getRtti(typelib_TypeDescription const & type) {
static RTTI theRttiFactory;
+ static std::mutex theMutex;
+ std::lock_guard aGuard(theMutex);
return theRttiFactory.getRTTI(type);
}