From 11761258ff734ac5fdb3885e14b32f7b5386cbdb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Widera?= Date: Thu, 14 Dec 2023 10:23:43 +0100 Subject: [PATCH] fix data race in test The thread sanitizer shows a data race in the cv test. --- test/cv.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/cv.cpp b/test/cv.cpp index e8727efb..7e53bce1 100644 --- a/test/cv.cpp +++ b/test/cv.cpp @@ -2,12 +2,13 @@ #include #include #include +#include TEST_CASE("CV") { for(int i=0; i< 5000; ++i) { - volatile bool finished = false; + std::atomic finished = {false}; volatile bool start = false; redGrapes::CondVar cv;