[Libreoffice-commits] core.git: sw/source
Noel Grandin (via logerrit)
logerrit at kemper.freedesktop.org
Tue Aug 3 07:08:13 UTC 2021
sw/source/core/docnode/finalthreadmanager.cxx | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
New commits:
commit dbca83e5b90a25be0841a1f4b4ff45b4e5f818cc
Author: Noel Grandin <noelgrandin at gmail.com>
AuthorDate: Mon Aug 2 20:29:01 2021 +0200
Commit: Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Tue Aug 3 09:07:40 2021 +0200
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 at collabora.co.uk>
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;
}
More information about the Libreoffice-commits
mailing list