summaryrefslogtreecommitdiff
path: root/cppcanvas
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2017-12-05 22:51:41 +0100
committerMichael Stahl <mstahl@redhat.com>2017-12-06 09:51:02 +0100
commita36b3f371343c4fb3708cbe0cd50270dda272385 (patch)
treed77c63252c698fcff2303607c36ad4089f6df63b /cppcanvas
parent745684f8a696d475ae0e910380031bacfdcba215 (diff)
tdf#113413 dbaccess: only use SolarMutex in ODatabaseDocument
The classes ODatabaseDocument, ODatabaseModelImpl and ODatabaseSource share a single mutex declared as ModelDependentComponent::m_aMutex. Commit 403eefe81b8a0afe888c60452c17d6b2c5d8343f 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 fca62934f492125ea6728fd6d09f0c66c9e4fa69 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. Change-Id: I94aaa0ae8698188c98633c638100a309b20976cc Reviewed-on: https://gerrit.libreoffice.org/45914 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Michael Stahl <mstahl@redhat.com>
Diffstat (limited to 'cppcanvas')
0 files changed, 0 insertions, 0 deletions