diff options
Diffstat (limited to 'configmgr/source/components.cxx')
-rw-r--r-- | configmgr/source/components.cxx | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/configmgr/source/components.cxx b/configmgr/source/components.cxx index 939d226e964d..60b74f8d18f0 100644 --- a/configmgr/source/components.cxx +++ b/configmgr/source/components.cxx @@ -164,22 +164,20 @@ private: OUString url_; Data const & data_; osl::Condition delay_; - std::shared_ptr<osl::Mutex> lock_; }; Components::WriteThread::WriteThread( rtl::Reference< WriteThread > * reference, Components & components, OUString const & url, Data const & data): Thread("configmgrWriter"), reference_(reference), components_(components), - url_(url), data_(data), - lock_( lock() ) + url_(url), data_(data) { assert(reference != nullptr); } void Components::WriteThread::execute() { delay_.wait(std::chrono::seconds(1)); // must not throw; result_error is harmless and ignored - osl::MutexGuard g(*lock_); // must not throw + osl::MutexGuard g(theConfigLock()); // must not throw try { try { writeModFile(components_, url_, data_); @@ -294,7 +292,7 @@ void Components::writeModifications() { void Components::flushModifications() { rtl::Reference< WriteThread > thread; { - osl::MutexGuard g(*lock_); + osl::MutexGuard g(theConfigLock()); thread = writeThread_; } if (thread.is()) { @@ -461,7 +459,6 @@ Components::Components( modificationTarget_(ModificationTarget::None) { assert(context.is()); - lock_ = lock(); OUString conf(expand("${CONFIGURATION_LAYERS}")); int layer = 0; for (sal_Int32 i = 0;;) { @@ -622,7 +619,7 @@ Components::~Components() if (bExitWasCalled) { // do not write, re-join threads - osl::MutexGuard g(*lock_); + osl::MutexGuard g(theConfigLock()); if (writeThread_.is()) { |