[Libreoffice-commits] core.git: ucb/source

Matúš Kukan matus.kukan at collabora.com
Tue Jul 8 00:15:30 PDT 2014


 ucb/source/ucp/webdav/webdavcontent.cxx |   12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

New commits:
commit 9da4e46957bd1a69c4339eeb1d107546c400e6e3
Author: Matúš Kukan <matus.kukan at collabora.com>
Date:   Tue Jul 8 09:00:51 2014 +0200

    webdav: fix locking in webdav_ucp::Content::getResourceType()
    
    This commit cherry-picks 49a454225e35699d7351faaba3d296e1858c6107
    for serf webdav version.
    
    Change-Id: Ic5aba4fba8f8a2a521224b08865500dd932e85bf

diff --git a/ucb/source/ucp/webdav/webdavcontent.cxx b/ucb/source/ucp/webdav/webdavcontent.cxx
index faca565..3829a0c 100644
--- a/ucb/source/ucp/webdav/webdavcontent.cxx
+++ b/ucb/source/ucp/webdav/webdavcontent.cxx
@@ -3410,7 +3410,17 @@ const Content::ResourceType & Content::getResourceType(
                     const uno::Reference< ucb::XCommandEnvironment >& xEnv )
     throw ( uno::Exception )
 {
-    return getResourceType( xEnv, m_xResAccess );
+    boost::scoped_ptr< DAVResourceAccess > xResAccess;
+    {
+        osl::MutexGuard aGuard( m_aMutex );
+        xResAccess.reset( new DAVResourceAccess( *m_xResAccess.get() ) );
+    }
+    const Content::ResourceType & ret = getResourceType( xEnv, xResAccess );
+    {
+        osl::Guard< osl::Mutex > aGuard( m_aMutex );
+        m_xResAccess.reset( new DAVResourceAccess( *xResAccess.get() ) );
+    }
+    return ret;
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


More information about the Libreoffice-commits mailing list