diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2021-08-02 20:29:01 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-08-03 09:07:40 +0200 |
commit | dbca83e5b90a25be0841a1f4b4ff45b4e5f818cc (patch) | |
tree | 47e085184a94ad1ef86b0ba98f24fccbe5a198e1 /sw | |
parent | db9d23d71978e32213234a9402798719f1872400 (diff) |
osl::Mutex->std::mutex in CancelJobsThread
Change-Id: If986577e4aff53080300c13c8586702f24699eb4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119915
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/docnode/finalthreadmanager.cxx | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/sw/source/core/docnode/finalthreadmanager.cxx b/sw/source/core/docnode/finalthreadmanager.cxx index 506d054b47e2..66483cd77449 100644 --- a/sw/source/core/docnode/finalthreadmanager.cxx +++ b/sw/source/core/docnode/finalthreadmanager.cxx @@ -28,6 +28,7 @@ #include <com/sun/star/frame/TerminationVetoException.hpp> #include <rtl/ustring.hxx> #include <cppuhelper/supportsservice.hxx> +#include <mutex> /** thread to cancel a give list of cancellable jobs @@ -56,7 +57,7 @@ class CancelJobsThread : public osl::Thread bool stopped() const; virtual void SAL_CALL run() override; - mutable osl::Mutex maMutex; + mutable std::mutex maMutex; std::list< css::uno::Reference< css::util::XCancellable > > maJobs; @@ -66,7 +67,7 @@ class CancelJobsThread : public osl::Thread void CancelJobsThread::addJobs( std::list< css::uno::Reference< css::util::XCancellable > >& rJobs ) { - osl::MutexGuard aGuard(maMutex); + std::lock_guard aGuard(maMutex); maJobs.insert( maJobs.end(), rJobs.begin(), rJobs.end() ); mbAllJobsCancelled = !maJobs.empty(); @@ -74,21 +75,21 @@ void CancelJobsThread::addJobs( std::list< css::uno::Reference< css::util::XCanc bool CancelJobsThread::existJobs() const { - osl::MutexGuard aGuard(maMutex); + std::lock_guard aGuard(maMutex); return !maJobs.empty(); } bool CancelJobsThread::allJobsCancelled() const { - osl::MutexGuard aGuard(maMutex); + std::lock_guard aGuard(maMutex); return maJobs.empty() && mbAllJobsCancelled; } void CancelJobsThread::stopWhenAllJobsCancelled() { - osl::MutexGuard aGuard(maMutex); + std::lock_guard aGuard(maMutex); mbStopped = true; } @@ -98,7 +99,7 @@ css::uno::Reference< css::util::XCancellable > CancelJobsThread::getNextJob() css::uno::Reference< css::util::XCancellable > xRet; { - osl::MutexGuard aGuard(maMutex); + std::lock_guard aGuard(maMutex); if ( !maJobs.empty() ) { @@ -112,7 +113,7 @@ css::uno::Reference< css::util::XCancellable > CancelJobsThread::getNextJob() bool CancelJobsThread::stopped() const { - osl::MutexGuard aGuard(maMutex); + std::lock_guard aGuard(maMutex); return mbStopped; } |