diff options
author | Caolán McNamara <caolanm@redhat.com> | 2021-10-03 14:55:33 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2021-10-03 20:56:28 +0200 |
commit | c0fa33a82e900558682c676243f279d267ca3eb3 (patch) | |
tree | 8078724b8f8b9f84dff42e26669846b35b8cfec8 | |
parent | 4b327251f3a7969d710d5a130472dba45122e354 (diff) |
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@redhat.com>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | vcl/source/graphic/Manager.cxx | 4 |
1 files changed, 4 insertions, 0 deletions
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()); |