-
Michael Stahl yazdı
The classes ODatabaseDocument, ODatabaseModelImpl and ODatabaseSource share a single mutex declared as ModelDependentComponent::m_aMutex. Commit 403eefe8 introduced a new deadlock here: in case Yield is called, such as when the user doesn't have a JRE and a dialog requesting to install one is displayed, the SolarMutex is released but the ModelDependentComponent mutex is still locked; now another thread (such as the AsyncEventNotifier) can lock the SolarMutex but not the other mutex, while the main thread can't lock the SolarMutex again. So the SolarMutex must be on the one hand be locked before the other mutex, to ensure the behaviour is the same whether the thread already holds it or not, and locked after the other mutex, to prevent the Yield deadlock. One option would be to revisit fca62934 and add back the SfxLibraryContainer mutex, but the code there is a mess, naively assuming that locking the mutex on UNO entry points is sufficient, taking no care to temporarily release it while calling other UNO components or event listeners; since there's about 5kLOC in all the related classes it would take some time to rewrite all that. An easier fix is to remove the ModelDependentComponent::m_aMutex. This patch removes all locking of that m_aMutex, but it still exists as a non-shared Mutex because it's needed for the WeakComponentImplHelper base classes, which shouldn't cause issues. Reviewed-on: https://gerrit.libreoffice.org/45914Tested-by:
Jenkins <ci@libreoffice.org> Reviewed-by:
Michael Stahl <mstahl@redhat.com> (cherry picked from commit a36b3f37) Change-Id: I94aaa0ae8698188c98633c638100a309b20976cc Reviewed-on: https://gerrit.libreoffice.org/45925Reviewed-by:
Noel Grandin <noel.grandin@collabora.co.uk> Tested-by:
Jenkins <ci@libreoffice.org> Reviewed-by:
Michael Stahl <mstahl@redhat.com>
83566e41