diff options
author | Arnaud Versini <arnaud.versini@libreoffice.org> | 2022-03-25 10:29:37 +0100 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-03-25 12:35:12 +0100 |
commit | 370b5dbe0d5e62c71b90c795f936dd7c9c240f36 (patch) | |
tree | 6f7dd95c938dcaa7b7d7cd13602f8ab9151ab387 /bridges/source | |
parent | d6ea4b8ffce91d7956cea0267c95ca69e208db24 (diff) |
bridges : use std::mutex in java brige
Change-Id: I07b215067b1cefc87919680fad3299d702ff6d1b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132100
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'bridges/source')
-rw-r--r-- | bridges/source/jni_uno/jni_info.cxx | 18 | ||||
-rw-r--r-- | bridges/source/jni_uno/jni_info.h | 4 |
2 files changed, 11 insertions, 11 deletions
diff --git a/bridges/source/jni_uno/jni_info.cxx b/bridges/source/jni_uno/jni_info.cxx index 70839e168eb2..16a5a1ac4d5c 100644 --- a/bridges/source/jni_uno/jni_info.cxx +++ b/bridges/source/jni_uno/jni_info.cxx @@ -369,18 +369,18 @@ JNI_type_info const * JNI_info::create_type_info( // look up JNI_type_info * info; - ClearableMutexGuard guard( m_mutex ); + std::unique_lock guard( m_mutex ); JNI_type_info_holder & holder = m_type_map[ uno_name ]; if (holder.m_info == nullptr) // new insertion { holder.m_info = new_info; - guard.clear(); + guard.unlock(); info = new_info; } else // inserted in the meantime { info = holder.m_info; - guard.clear(); + guard.unlock(); new_info->destroy( jni.get_jni_env() ); } return info; @@ -397,12 +397,12 @@ JNI_type_info const * JNI_info::get_type_info( OUString const & uno_name = OUString::unacquired( &td->pTypeName ); JNI_type_info const * info; - ClearableMutexGuard guard( m_mutex ); + std::unique_lock guard( m_mutex ); t_str2type::const_iterator iFind( m_type_map.find( uno_name ) ); if (iFind == m_type_map.end()) { - guard.clear(); + guard.unlock(); info = create_type_info( jni, td ); } else @@ -424,11 +424,11 @@ JNI_type_info const * JNI_info::get_type_info( OUString const & uno_name = OUString::unacquired( &type->pTypeName ); JNI_type_info const * info; - ClearableMutexGuard guard( m_mutex ); + std::unique_lock guard( m_mutex ); t_str2type::const_iterator iFind( m_type_map.find( uno_name ) ); if (iFind == m_type_map.end()) { - guard.clear(); + guard.unlock(); TypeDescr td( type ); info = create_type_info( jni, td.get() ); } @@ -450,11 +450,11 @@ JNI_type_info const * JNI_info::get_type_info( } JNI_type_info const * info; - ClearableMutexGuard guard( m_mutex ); + std::unique_lock guard( m_mutex ); t_str2type::const_iterator iFind( m_type_map.find( uno_name ) ); if (iFind == m_type_map.end()) { - guard.clear(); + guard.unlock(); css::uno::TypeDescription td( uno_name ); if (! td.is()) { diff --git a/bridges/source/jni_uno/jni_info.h b/bridges/source/jni_uno/jni_info.h index ede5f1718316..7a18e553e400 100644 --- a/bridges/source/jni_uno/jni_info.h +++ b/bridges/source/jni_uno/jni_info.h @@ -25,7 +25,7 @@ #include "jni_base.h" -#include <osl/mutex.hxx> +#include <mutex> #include <rtl/ref.hxx> #include <rtl/ustring.hxx> #include <rtl/strbuf.hxx> @@ -122,7 +122,7 @@ typedef std::unordered_map< class JNI_info { - mutable ::osl::Mutex m_mutex; + mutable std::mutex m_mutex; mutable t_str2type m_type_map; public: |