summaryrefslogtreecommitdiff
path: root/svl
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2023-02-17 13:11:06 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2023-02-18 09:48:20 +0000
commitcb9492ce8a54848b5418a0efdf2beeb7999f3e54 (patch)
tree9ab5c09f60a6fabdb9a25a6a0bcc15a3b0716b94 /svl
parent63976f2b6dcf034d5cf119e1218606a117a7bb5e (diff)
osl::Mutex->std::mutex in SysCredentialsConfigItem
Change-Id: If1e938381917bf2d538ca663961782430e7cbf77 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147230 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svl')
-rw-r--r--svl/source/passwordcontainer/syscreds.cxx16
-rw-r--r--svl/source/passwordcontainer/syscreds.hxx3
2 files changed, 13 insertions, 6 deletions
diff --git a/svl/source/passwordcontainer/syscreds.cxx b/svl/source/passwordcontainer/syscreds.cxx
index a537455e4172..8de4a82f0d9a 100644
--- a/svl/source/passwordcontainer/syscreds.cxx
+++ b/svl/source/passwordcontainer/syscreds.cxx
@@ -38,10 +38,10 @@ void SysCredentialsConfigItem::Notify(
const uno::Sequence< OUString > & /*seqPropertyNames*/ )
{
{
- ::osl::MutexGuard aGuard( m_aMutex );
+ std::unique_lock aGuard( m_aMutex );
m_bInited = false;
// rebuild m_seqURLs
- getSystemCredentialsURLs();
+ getSystemCredentialsURLs(aGuard);
}
m_pOwner->persistentConfigChanged();
}
@@ -54,7 +54,13 @@ void SysCredentialsConfigItem::ImplCommit()
uno::Sequence< OUString >
SysCredentialsConfigItem::getSystemCredentialsURLs()
{
- ::osl::MutexGuard aGuard( m_aMutex );
+ std::unique_lock aGuard(m_aMutex);
+ return getSystemCredentialsURLs(aGuard);
+}
+
+uno::Sequence< OUString >
+SysCredentialsConfigItem::getSystemCredentialsURLs(std::unique_lock<std::mutex>& /*rGuard*/)
+{
if ( !m_bInited )
{
// read config item
@@ -81,8 +87,6 @@ SysCredentialsConfigItem::getSystemCredentialsURLs()
void SysCredentialsConfigItem::setSystemCredentialsURLs(
const uno::Sequence< OUString > & seqURLList )
{
- ::osl::MutexGuard aGuard( m_aMutex );
-
// write config item.
uno::Sequence< OUString > aPropNames{ "AuthenticateUsingSystemCredentials" };
uno::Sequence< uno::Any > aPropValues{ uno::Any(seqURLList) };
@@ -90,6 +94,8 @@ void SysCredentialsConfigItem::setSystemCredentialsURLs(
utl::ConfigItem::SetModified();
utl::ConfigItem::PutProperties( aPropNames, aPropValues );
+ std::unique_lock aGuard( m_aMutex );
+
m_seqURLs = seqURLList;
m_bInited = true;
}
diff --git a/svl/source/passwordcontainer/syscreds.hxx b/svl/source/passwordcontainer/syscreds.hxx
index 7f18243746b7..75241c4e79dd 100644
--- a/svl/source/passwordcontainer/syscreds.hxx
+++ b/svl/source/passwordcontainer/syscreds.hxx
@@ -44,9 +44,10 @@ class SysCredentialsConfigItem : public utl::ConfigItem
//bool isSystemCredentialsURL( const OUString & rURL ) const;
private:
+ css::uno::Sequence< OUString > getSystemCredentialsURLs(std::unique_lock<std::mutex>& rGuard);
virtual void ImplCommit() override;
- ::osl::Mutex m_aMutex;
+ std::mutex m_aMutex;
bool m_bInited;
css::uno::Sequence< OUString > m_seqURLs;
SysCredentialsConfig * m_pOwner;