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
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 6e022515..242e2a4 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);
}