[libcxx-commits] [libcxx] [libc++] Fix sporadic test failure in condition_variable notify_all test (PR #97622)

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Wed Jul 3 12:57:21 PDT 2024


================
@@ -29,10 +30,13 @@ int test0 = 0;
 int test1 = 0;
 int test2 = 0;
 
+std::atomic<int> ready_count = 0;
+
 void f1()
 {
     std::unique_lock<std::mutex> lk(mut);
     assert(test1 == 0);
+    ready_count.fetch_add(1);
----------------
ldionne wrote:

Slight preference for `ready_count += 1` since that's easier to read.

https://github.com/llvm/llvm-project/pull/97622


More information about the libcxx-commits mailing list