diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2024-03-25 09:05:00 +0500 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2024-03-25 06:27:32 +0100 |
commit | fb94c8f64a15ff4bf45f1d2adfab9cb50a696d71 (patch) | |
tree | d5bd4189c774a44b71844e1fc8cefa36ac711534 /fpicker | |
parent | 1344e6261a1d856c71eca1e0cc29215a586bf335 (diff) |
Relax SolarMutexReleaser precondition to not require SolarMutex lock
As discussed on https://gerrit.libreoffice.org/c/core/+/164843/2#message-8873d3d119de7206b33bc824f5809b8b1d3d97da,
it is impossible at times to know in advance, if a specific code, that
must not be guarded by SolarMutex (e.g., calling to other threads, which
might need to grab the mutex), will itself be guarded by SolarMutex.
Before this change, a required pre-requisite for SolarMutexReleaser use
was existing lock of SolarMutex; otherwise, an attempt to release it
would call abort(). Thus, in some places we had to grab the mutex prior
to releasing it, and that itself introduced more potential for deadlock.
Now the SolarMutexReleaser is safe to use without the lock, in which
case, it will do nothing.
Change-Id: I8759c2f6ed448598b3be4d6c5109804b5e7523ed
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165262
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'fpicker')
-rw-r--r-- | fpicker/source/win32/VistaFilePickerImpl.cxx | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/fpicker/source/win32/VistaFilePickerImpl.cxx b/fpicker/source/win32/VistaFilePickerImpl.cxx index 8a2531ab0119..a3ee8c9ad3e2 100644 --- a/fpicker/source/win32/VistaFilePickerImpl.cxx +++ b/fpicker/source/win32/VistaFilePickerImpl.cxx @@ -946,7 +946,6 @@ void VistaFilePickerImpl::impl_sta_ShowDialogModal(Request& rRequest) { // tdf#146007: Make sure we don't hold solar mutex: COM may need to forward // the execution to the main thread, and holding solar mutex could deadlock - SolarMutexGuard g; // First acquire, to avoid releaser failure SolarMutexReleaser r; // show dialog and wait for user decision hResult = iDialog->Show(m_hParentWindow ? m_hParentWindow |