diff options
-rw-r--r-- | svl/source/passwordcontainer/syscreds.cxx | 16 | ||||
-rw-r--r-- | svl/source/passwordcontainer/syscreds.hxx | 3 |
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; |