From b0163975efc6924c154793590a759784ffa77d08 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Thu, 23 Dec 2021 22:24:27 +0200 Subject: [PATCH] osl::Mutex->std::mutex in OCipherContext Change-Id: I0a457dc8ddccc0fce42032956aff6d661d1ae80a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127403 Tested-by: Jenkins Reviewed-by: Noel Grandin --- xmlsecurity/source/xmlsec/nss/ciphercontext.cxx | 6 ++---- xmlsecurity/source/xmlsec/nss/ciphercontext.hxx | 4 ++-- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/xmlsecurity/source/xmlsec/nss/ciphercontext.cxx b/xmlsecurity/source/xmlsec/nss/ciphercontext.cxx index c4d1c6113bf6..ff3441249435 100644 --- a/xmlsecurity/source/xmlsec/nss/ciphercontext.cxx +++ b/xmlsecurity/source/xmlsec/nss/ciphercontext.cxx @@ -63,8 +63,6 @@ uno::Reference< xml::crypto::XCipherContext > OCipherContext::Create( CK_MECHANI void OCipherContext::Dispose() { - ::osl::MutexGuard aGuard( m_aMutex ); - if ( m_pContext ) { PK11_DestroyContext( m_pContext, PR_TRUE ); @@ -94,7 +92,7 @@ void OCipherContext::Dispose() uno::Sequence< ::sal_Int8 > SAL_CALL OCipherContext::convertWithCipherContext( const uno::Sequence< ::sal_Int8 >& aData ) { - ::osl::MutexGuard aGuard( m_aMutex ); + std::unique_lock aGuard( m_aMutex ); if ( m_bBroken ) throw uno::RuntimeException(); @@ -174,7 +172,7 @@ uno::Sequence< ::sal_Int8 > SAL_CALL OCipherContext::convertWithCipherContext( c uno::Sequence< ::sal_Int8 > SAL_CALL OCipherContext::finalizeCipherContextAndDispose() { - ::osl::MutexGuard aGuard( m_aMutex ); + std::unique_lock aGuard( m_aMutex ); if ( m_bBroken ) throw uno::RuntimeException(); diff --git a/xmlsecurity/source/xmlsec/nss/ciphercontext.hxx b/xmlsecurity/source/xmlsec/nss/ciphercontext.hxx index 3ac5df6c7fd0..40b610ef512e 100644 --- a/xmlsecurity/source/xmlsec/nss/ciphercontext.hxx +++ b/xmlsecurity/source/xmlsec/nss/ciphercontext.hxx @@ -22,14 +22,14 @@ #include #include -#include +#include #include #include class OCipherContext : public cppu::WeakImplHelper< css::xml::crypto::XCipherContext > { private: - ::osl::Mutex m_aMutex; + std::mutex m_aMutex; PK11SlotInfo* m_pSlot; PK11SymKey* m_pSymKey;