diff options
author | Patrick Luby <guibmacdev@gmail.com> | 2024-04-02 10:38:58 -0400 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2024-04-02 21:10:19 +0200 |
commit | 89e23bb599104d3bde30878148e15cf4deb1593f (patch) | |
tree | ee13ed5c4957568094e04ad78cfe0c0a840deb2e /desktop | |
parent | db040630d664fa20bc4f8995d2168fcce51a8bfd (diff) |
tdf#159790 eliminate deadlock on main thread
A separate thread may have already acquired m_aMutex and that
thread will then try to acquire the solar mutex. However, when
the main thread calls this method, the main thread has already
acquired the solar mutex.
So, drop the desktop mutex before calling out.
Change-Id: Ic87063266ac5101b866df9f24067a403e1417745
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165682
Reviewed-by: Patrick Luby <guibomacdev@gmail.com>
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'desktop')
-rw-r--r-- | desktop/source/deployment/registry/configuration/dp_configuration.cxx | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/desktop/source/deployment/registry/configuration/dp_configuration.cxx b/desktop/source/deployment/registry/configuration/dp_configuration.cxx index 3bfac940bce6..9ef3cc969432 100644 --- a/desktop/source/deployment/registry/configuration/dp_configuration.cxx +++ b/desktop/source/deployment/registry/configuration/dp_configuration.cxx @@ -653,7 +653,7 @@ OUString replaceOrigin( void BackendImpl::PackageImpl::processPackage_( - ::osl::ResettableMutexGuard &, + ::osl::ResettableMutexGuard & guard, bool doRegisterPackage, bool startup, ::rtl::Reference<AbortChannel> const &, @@ -688,7 +688,10 @@ void BackendImpl::PackageImpl::processPackage_( if ((that->m_eContext != Context::Bundled && !startup) || comphelper::LibreOfficeKit::isActive()) { - if (m_isSchema) + bool bIsSchema = m_isSchema; + // tdf#159790 prevent lock-ordering deadlock, the code below might acquire the solar mutex + guard.clear(); + if (bIsSchema) { css::configuration::Update::get( that->m_xComponentContext)->insertExtensionXcsFile( @@ -700,6 +703,7 @@ void BackendImpl::PackageImpl::processPackage_( that->m_xComponentContext)->insertExtensionXcuFile( that->m_eContext == Context::Shared, expandUnoRcUrl(url)); } + guard.reset(); } that->addToConfigmgrIni( m_isSchema, true, url, xCmdEnv ); data.iniEntry = dp_misc::makeRcTerm(url); |