From c0fa33a82e900558682c676243f279d267ca3eb3 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Sun, 3 Oct 2021 14:55:33 +0100 Subject: cid#1492171 annotate Data race condition MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit and cid#1492172 Data race condition Change-Id: I2ab0d3af626b8d8007082a3dd944149973f8b63e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123026 Tested-by: Caolán McNamara Reviewed-by: Caolán McNamara --- vcl/source/graphic/Manager.cxx | 4 ++++ 1 file changed, 4 insertions(+) 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& 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& 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()); -- cgit