[Libreoffice-commits] core.git: vcl/source
Caolán McNamara (via logerrit)
logerrit at kemper.freedesktop.org
Sun Oct 3 18:57:02 UTC 2021
vcl/source/graphic/Manager.cxx | 4 ++++
1 file changed, 4 insertions(+)
New commits:
commit c0fa33a82e900558682c676243f279d267ca3eb3
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Sun Oct 3 14:55:33 2021 +0100
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Sun Oct 3 20:56:28 2021 +0200
cid#1492171 annotate Data race condition
and
cid#1492172 Data race condition
Change-Id: I2ab0d3af626b8d8007082a3dd944149973f8b63e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123026
Tested-by: Caolán McNamara <caolanm at redhat.com>
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/vcl/source/graphic/Manager.cxx b/vcl/source/graphic/Manager.cxx
index b07c52b9541c..bdb5ba7ef432 100644
--- a/vcl/source/graphic/Manager.cxx
+++ b/vcl/source/graphic/Manager.cxx
@@ -140,6 +140,8 @@ void Manager::reduceGraphicMemory(std::unique_lock<std::mutex>& rGuard)
if (calculatedSize != mnUsedSize)
{
+ assert(rGuard.owns_lock() && rGuard.mutex() == &maMutex);
+ // coverity[missing_lock: FALSE] - as above assert
mnUsedSize = calculatedSize;
}
@@ -171,6 +173,8 @@ void Manager::registerGraphic(const std::shared_ptr<ImpGraphic>& pImpGraphic)
reduceGraphicMemory(aGuard);
// Insert and update the used size (bytes)
+ assert(aGuard.owns_lock() && aGuard.mutex() == &maMutex);
+ // coverity[missing_lock: FALSE] - as above assert
mnUsedSize += getGraphicSizeBytes(pImpGraphic.get());
m_pImpGraphicList.insert(pImpGraphic.get());
More information about the Libreoffice-commits
mailing list