summaryrefslogtreecommitdiff
path: root/configmgr/source/configurationprovider.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'configmgr/source/configurationprovider.cxx')
-rw-r--r--configmgr/source/configurationprovider.cxx15
1 files changed, 9 insertions, 6 deletions
diff --git a/configmgr/source/configurationprovider.cxx b/configmgr/source/configurationprovider.cxx
index bc9615432224..f9936b6ba1a3 100644
--- a/configmgr/source/configurationprovider.cxx
+++ b/configmgr/source/configurationprovider.cxx
@@ -85,7 +85,8 @@ class Service:
public:
explicit Service(
const css::uno::Reference< css::uno::XComponentContext >& context):
- ServiceBase(m_aMutex), context_(context), default_(true)
+ ServiceBase(m_aMutex), context_(context), default_(true),
+ lock_( lock() )
{
assert(context.is());
}
@@ -94,7 +95,8 @@ public:
const css::uno::Reference< css::uno::XComponentContext >& context,
OUString const & locale):
ServiceBase(m_aMutex), context_(context), locale_(locale),
- default_(false)
+ default_(false),
+ lock_( lock() )
{
assert(context.is());
}
@@ -161,6 +163,7 @@ private:
css::uno::Reference< css::uno::XComponentContext > context_;
OUString locale_;
bool default_;
+ std::shared_ptr<osl::Mutex> lock_;
};
css::uno::Reference< css::uno::XInterface > Service::createInstance(
@@ -246,7 +249,7 @@ Service::createInstanceWithArguments(
" service " + ServiceSpecifier),
static_cast< cppu::OWeakObject * >(this));
}
- osl::MutexGuard guard(configmgr::GetLock());
+ osl::MutexGuard guard(*lock_);
Components & components = Components::getSingleton(context_);
rtl::Reference root(
new RootAccess(components, nodepath, locale, update));
@@ -314,12 +317,12 @@ void Service::removeFlushListener(
void Service::setLocale(css::lang::Locale const & eLocale)
{
- osl::MutexGuard guard(configmgr::GetLock());
+ osl::MutexGuard guard(*lock_);
locale_ = LanguageTag::convertToBcp47( eLocale, false);
}
css::lang::Locale Service::getLocale() {
- osl::MutexGuard guard(configmgr::GetLock());
+ osl::MutexGuard guard(*lock_);
css::lang::Locale loc;
if (! locale_.isEmpty()) {
loc = LanguageTag::convertToLocale( locale_, false);
@@ -330,7 +333,7 @@ css::lang::Locale Service::getLocale() {
void Service::flushModifications() const {
Components * components;
{
- osl::MutexGuard guard(configmgr::GetLock());
+ osl::MutexGuard guard(*lock_);
components = &Components::getSingleton(context_);
}
components->flushModifications();