sc/inc/refreshtimer.hxx |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 321325452c16e5e0f9e5258bb2ccdbfff63acc12
Author:     Eike Rathke <er...@redhat.com>
AuthorDate: Sat Feb 26 01:57:51 2022 +0100
Commit:     Mike Kaganski <mike.kagan...@collabora.com>
CommitDate: Sun Feb 27 10:38:23 2022 +0100

    Resolves: tdf#147448 ScRefreshTimerControl mutex must be 
std::recursive_mutex
    
    ScRefreshTimer::Invoke() locks the mutex and subsequent nested
    locks are attempted in ScDocShell::ConvertFrom() and
    ScDocShellModificator ctor by ScRefreshTimerProtector.
    
    A std::mutex must not be owned by the calling thread when a lock
    is attempted, otherwise even deadlocks may occur, as was the case
    here. This is exactly the difference of std::recursive_mutex.
    
    Likely a regression from
    
        commit 287680683ca266f1fb4f447ac9bdaf76669d559d
        CommitDate: Mon Aug 2 12:17:07 2021 +0200
    
            osl::Mutex->std::mutex in ScRefreshTimer
    
    Change-Id: Iaa0f1da2b4b9616e9627d8d0001775f554756048
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130573
    Reviewed-by: Eike Rathke <er...@redhat.com>
    Tested-by: Jenkins
    (cherry picked from commit 4361ee2585e616cb3c504eb719deca4076de78da)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130551
    Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com>

diff --git a/sc/inc/refreshtimer.hxx b/sc/inc/refreshtimer.hxx
index 9582d1b19a2c..e6be7431d9e5 100644
--- a/sc/inc/refreshtimer.hxx
+++ b/sc/inc/refreshtimer.hxx
@@ -29,14 +29,14 @@
 
 class ScRefreshTimerControl
 {
-    std::mutex      aMutex;
-    sal_uInt16      nBlockRefresh;
+    std::recursive_mutex    aMutex;
+    sal_uInt16              nBlockRefresh;
 
 public:
     ScRefreshTimerControl() : nBlockRefresh(0) {}
     void SetAllowRefresh( bool b );
     bool IsRefreshAllowed() const { return !nBlockRefresh; }
-    std::mutex& GetMutex() { return aMutex; }
+    std::recursive_mutex& GetMutex() { return aMutex; }
 };
 
 class ScRefreshTimer : public AutoTimer

Reply via email to