[Libreoffice-commits] core.git: comphelper/qa

Noel Grandin (via logerrit) logerrit at kemper.freedesktop.org
Fri Jul 30 09:34:08 UTC 2021


 comphelper/qa/unit/threadpooltest.cxx |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 8618707dd9d7de2a439ab361d7ff6bca373670c4
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Fri Jul 30 09:34:51 2021 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Fri Jul 30 11:33:31 2021 +0200

    tsan:data race in ThreadPoolTest::testWorkerUsage
    
    Change-Id: Id63b9f1dd7ed163236837258e8dbad2feb9f1c5e
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119695
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/comphelper/qa/unit/threadpooltest.cxx b/comphelper/qa/unit/threadpooltest.cxx
index 890fdfe93f22..14da59988ef4 100644
--- a/comphelper/qa/unit/threadpooltest.cxx
+++ b/comphelper/qa/unit/threadpooltest.cxx
@@ -16,6 +16,7 @@
 #include <osl/thread.hxx>
 
 #include <stdlib.h>
+#include <atomic>
 #include <thread>
 #include <mutex>
 
@@ -74,7 +75,7 @@ public:
         mutex.lock();
         mutex.unlock();
     }
-    static inline int count = 0;
+    static inline std::atomic<int> count = 0;
     static inline std::mutex mutex;
 };
 } // namespace


More information about the Libreoffice-commits mailing list