[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - ucb/source
Mike Kaganski (via logerrit)
logerrit at kemper.freedesktop.org
Mon Jul 15 08:58:36 UTC 2019
ucb/source/ucp/webdav-neon/NeonLockStore.cxx | 13 ++++++++++++-
ucb/source/ucp/webdav-neon/NeonLockStore.hxx | 2 ++
ucb/source/ucp/webdav-neon/NeonSession.cxx | 1 +
3 files changed, 15 insertions(+), 1 deletion(-)
New commits:
commit 716dff2767aad7060fc1b48377cdfeedd9487428
Author: Mike Kaganski <mike.kaganski at collabora.com>
AuthorDate: Mon Jul 8 23:47:12 2019 +1000
Commit: Mike Kaganski <mike.kaganski at collabora.com>
CommitDate: Mon Jul 15 10:57:51 2019 +0200
tdf#126279 related: remove locks from NeonLockStore after NE_AUTH error
Change-Id: Idbbb9bb215e3a56e72a29f798c5a5f84afaf2213
Reviewed-on: https://gerrit.libreoffice.org/75224
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>
(cherry picked from commit 94e4695bcfcb9356d37942c47359b94531ef7b95)
Reviewed-on: https://gerrit.libreoffice.org/75611
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
diff --git a/ucb/source/ucp/webdav-neon/NeonLockStore.cxx b/ucb/source/ucp/webdav-neon/NeonLockStore.cxx
index 4543778fa81a..5e8c469dfedd 100644
--- a/ucb/source/ucp/webdav-neon/NeonLockStore.cxx
+++ b/ucb/source/ucp/webdav-neon/NeonLockStore.cxx
@@ -150,7 +150,7 @@ void NeonLockStore::stopTicker(osl::ClearableMutexGuard & rGuard)
rGuard.clear();
- if (pTickerThread.is())
+ if (pTickerThread.is() && pTickerThread->getIdentifier() != osl::Thread::getCurrentIdentifier())
pTickerThread->join(); // without m_aMutex locked (to prevent deadlock)
}
@@ -195,6 +195,13 @@ void NeonLockStore::removeLock( NeonLock * pLock )
stopTicker(aGuard);
}
+void NeonLockStore::removeLockDeferred(NeonLock* pLock)
+{
+ osl::MutexGuard aGuard(m_aMutex);
+
+ m_aRemoveDeferred.push_back(pLock);
+}
+
void NeonLockStore::refreshLocks()
{
osl::MutexGuard aGuard( m_aMutex );
@@ -227,6 +234,10 @@ void NeonLockStore::refreshLocks()
}
}
}
+ // removeLock will not need to actually release the lock, because this is run from TickerThread
+ for (auto pLock : m_aRemoveDeferred)
+ removeLock(pLock);
+ m_aRemoveDeferred.clear();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/ucb/source/ucp/webdav-neon/NeonLockStore.hxx b/ucb/source/ucp/webdav-neon/NeonLockStore.hxx
index 0cee2063fd31..86fccb68a50f 100644
--- a/ucb/source/ucp/webdav-neon/NeonLockStore.hxx
+++ b/ucb/source/ucp/webdav-neon/NeonLockStore.hxx
@@ -66,6 +66,7 @@ class NeonLockStore
ne_lock_store * const m_pNeonLockStore;
rtl::Reference< TickerThread > m_pTickerThread;
LockInfoMap m_aLockInfoMap;
+ std::vector<NeonLock*> m_aRemoveDeferred;
public:
NeonLockStore();
@@ -82,6 +83,7 @@ public:
sal_Int32 nLastChanceToSendRefreshRequest );
void removeLock( NeonLock * pLock );
+ void removeLockDeferred(NeonLock* pLock);
void refreshLocks();
diff --git a/ucb/source/ucp/webdav-neon/NeonSession.cxx b/ucb/source/ucp/webdav-neon/NeonSession.cxx
index 2f989b5ee48a..6b9e88e2f8e2 100644
--- a/ucb/source/ucp/webdav-neon/NeonSession.cxx
+++ b/ucb/source/ucp/webdav-neon/NeonSession.cxx
@@ -1682,6 +1682,7 @@ bool NeonSession::LOCK( NeonLock * pLock,
{
// tdf#126279: see handling of NE_AUTH in HandleError
m_bNeedNewSession = true;
+ m_aNeonLockStore.removeLockDeferred(pLock);
}
return false;
}
More information about the Libreoffice-commits
mailing list