diff options
author | Arnaud Versini <arnaud.versini@libreoffice.org> | 2021-05-30 19:32:41 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-05-31 15:21:39 +0200 |
commit | d220fc00c2c3d7a2a24fd762599d1bfcc27f34d5 (patch) | |
tree | 0936cdc1c063c441bfbb818f00842641714384df /sdext/source/pdfimport | |
parent | 39aa29712fe4c7a1c432cecf03d9d491537c02e6 (diff) |
sdext : use std::mutex when possible
Change-Id: Ia610c0c46e017452db71945f6f53fedbcb6d1198
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116415
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sdext/source/pdfimport')
-rw-r--r-- | sdext/source/pdfimport/misc/pwdinteract.cxx | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/sdext/source/pdfimport/misc/pwdinteract.cxx b/sdext/source/pdfimport/misc/pwdinteract.cxx index 4179795cc073..9885a6606a54 100644 --- a/sdext/source/pdfimport/misc/pwdinteract.cxx +++ b/sdext/source/pdfimport/misc/pwdinteract.cxx @@ -20,6 +20,7 @@ #include <sal/config.h> #include <cassert> +#include <mutex> #include <pdfihelper.hxx> @@ -44,7 +45,7 @@ class PDFPasswordRequest: task::XInteractionRequest, task::XInteractionPassword > { private: - mutable osl::Mutex m_aMutex; + mutable std::mutex m_aMutex; uno::Any m_aRequest; OUString m_aPassword; bool m_bSelected; @@ -65,7 +66,7 @@ public: // XInteractionContinuation virtual void SAL_CALL select() override; - bool isSelected() const { osl::MutexGuard const guard( m_aMutex ); return m_bSelected; } + bool isSelected() const { std::scoped_lock const guard( m_aMutex ); return m_bSelected; } private: virtual ~PDFPasswordRequest() override {} @@ -98,21 +99,21 @@ uno::Sequence< uno::Reference< task::XInteractionContinuation > > PDFPasswordReq void PDFPasswordRequest::setPassword( const OUString& rPwd ) { - osl::MutexGuard const guard( m_aMutex ); + std::scoped_lock const guard( m_aMutex ); m_aPassword = rPwd; } OUString PDFPasswordRequest::getPassword() { - osl::MutexGuard const guard( m_aMutex ); + std::scoped_lock const guard( m_aMutex ); return m_aPassword; } void PDFPasswordRequest::select() { - osl::MutexGuard const guard( m_aMutex ); + std::scoped_lock const guard( m_aMutex ); m_bSelected = true; } |