diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2021-11-21 11:53:36 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-11-21 15:47:17 +0100 |
commit | efd95650cba2460bc153de00f8eb27785ad0e18a (patch) | |
tree | b64a52cf2dda2825d027eb79a2776a3edc52f516 /framework | |
parent | c3b968a2f1e8e824ace86c37d0e500440374bd09 (diff) |
osl::Mutex->std::mutex in framework::ConfigAccess
Change-Id: I44d41db2498ea39fca309785278c1fe50d7ae8b9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125617
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'framework')
-rw-r--r-- | framework/inc/jobs/configaccess.hxx | 5 | ||||
-rw-r--r-- | framework/source/fwi/jobs/configaccess.cxx | 13 |
2 files changed, 12 insertions, 6 deletions
diff --git a/framework/inc/jobs/configaccess.hxx b/framework/inc/jobs/configaccess.hxx index 4d73df2e1c46..19d9265f952a 100644 --- a/framework/inc/jobs/configaccess.hxx +++ b/framework/inc/jobs/configaccess.hxx @@ -20,8 +20,8 @@ #pragma once #include <com/sun/star/uno/XComponentContext.hpp> - #include <rtl/ustring.hxx> +#include <mutex> namespace framework{ @@ -50,7 +50,7 @@ class ConfigAccess final // member private: - mutable osl::Mutex m_mutex; + mutable std::mutex m_mutex; /** reference to the uno service manager @@ -69,6 +69,7 @@ class ConfigAccess final // native interface methods + void closeImpl(); public: ConfigAccess( const css::uno::Reference< css::uno::XComponentContext >& rxContext, diff --git a/framework/source/fwi/jobs/configaccess.cxx b/framework/source/fwi/jobs/configaccess.cxx index d3ce0e5f70a1..27f2c3dd9572 100644 --- a/framework/source/fwi/jobs/configaccess.cxx +++ b/framework/source/fwi/jobs/configaccess.cxx @@ -67,7 +67,7 @@ ConfigAccess::~ConfigAccess() */ ConfigAccess::EOpenMode ConfigAccess::getMode() const { - osl::MutexGuard g(m_mutex); + std::unique_lock g(m_mutex); return m_eMode; } @@ -87,7 +87,7 @@ ConfigAccess::EOpenMode ConfigAccess::getMode() const */ void ConfigAccess::open( /*IN*/ EOpenMode eMode ) { - osl::MutexGuard g(m_mutex); + std::unique_lock g(m_mutex); // check if configuration is already open in the right mode. // By the way: Don't allow closing by using this method! @@ -99,7 +99,7 @@ void ConfigAccess::open( /*IN*/ EOpenMode eMode ) // can be called without checks! It does the checks by itself ... // e.g. for already closed or not opened configuration. // Flushing of all made changes will be done here too. - close(); + closeImpl(); // create the configuration provider, which provides sub access points css::uno::Reference< css::lang::XMultiServiceFactory > xConfigProvider = css::configuration::theDefaultProvider::get(m_xContext); @@ -135,7 +135,12 @@ void ConfigAccess::open( /*IN*/ EOpenMode eMode ) */ void ConfigAccess::close() { - osl::MutexGuard g(m_mutex); + std::unique_lock g(m_mutex); + closeImpl(); +} + +void ConfigAccess::closeImpl() +{ // check already closed configuration if (m_xConfig.is()) { |