ucb/source/ucp/webdav-curl/SerfLockStore.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
New commits: commit 3f3aed00458d64bf32f5faa25c88f959430dea3a Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Thu Aug 7 11:41:04 2025 +0100 Commit: Caolán McNamara <caolan.mcnam...@collabora.com> CommitDate: Wed Aug 20 09:27:02 2025 +0200 cid#1642989 Wait without held lock restore the lock at the end of SerfLockStore::stopTicker SerfLockStore::removeLockImpl calls this, and that is called by SerfLockStore::refreshLocks in a loop, so if it was unlocked at the end of the first loop, then its still unlocked on a 2nd loop. Probably doesn't matter as there's only a 2nd unlock attempt if m_aLockInfoMap.empty() which presumably can only happen once. Change-Id: Iede91b1b4ef9368bcf4e62cb85bf5a0c745e0ba7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189058 Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> Tested-by: Jenkins diff --git a/ucb/source/ucp/webdav-curl/SerfLockStore.cxx b/ucb/source/ucp/webdav-curl/SerfLockStore.cxx index c12bdfedf6de..c367f1445c54 100644 --- a/ucb/source/ucp/webdav-curl/SerfLockStore.cxx +++ b/ucb/source/ucp/webdav-curl/SerfLockStore.cxx @@ -93,7 +93,7 @@ SerfLockStore::~SerfLockStore() { std::unique_lock aGuard(m_aMutex); stopTicker(aGuard); - aGuard.lock(); // actually no threads should even try to access members now + assert(aGuard.owns_lock()); // actually no threads should even try to access members now // release active locks, if any. SAL_WARN_IF( !m_aLockInfoMap.empty(), "ucb.ucp.webdav", @@ -133,6 +133,8 @@ void SerfLockStore::stopTicker(std::unique_lock<std::mutex> & rGuard) { pTickerThread->join(); // without m_aMutex locked (to prevent deadlock) } + + rGuard.lock(); } bool SerfLockStore::joinThreads()