[libcxx-commits] [libcxx] 4a1fe09 - [libc++] Fix potentially flaky test joinable.pass.cpp

via libcxx-commits libcxx-commits at lists.llvm.org
Sat Sep 16 15:11:19 PDT 2023


Author: Hui
Date: 2023-09-16T23:07:46+01:00
New Revision: 4a1fe09b189f100e2fb53105bbcd7b15b8adf4f8

URL: https://github.com/llvm/llvm-project/commit/4a1fe09b189f100e2fb53105bbcd7b15b8adf4f8
DIFF: https://github.com/llvm/llvm-project/commit/4a1fe09b189f100e2fb53105bbcd7b15b8adf4f8.diff

LOG: [libc++] Fix potentially flaky test joinable.pass.cpp

This is a follow up of
https://reviews.llvm.org/D151559

Where one test point is potentially falky due to a race condition.

Added: 
    

Modified: 
    libcxx/test/std/thread/thread.jthread/joinable.pass.cpp

Removed: 
    


################################################################################
diff  --git a/libcxx/test/std/thread/thread.jthread/joinable.pass.cpp b/libcxx/test/std/thread/thread.jthread/joinable.pass.cpp
index 8d9619bdefd8cef..5c0fbece4c21e47 100644
--- a/libcxx/test/std/thread/thread.jthread/joinable.pass.cpp
+++ b/libcxx/test/std/thread/thread.jthread/joinable.pass.cpp
@@ -45,6 +45,7 @@ int main(int, char**) {
     const std::jthread jt{[&done] { done.wait(false); }};
     std::same_as<bool> decltype(auto) result = jt.joinable();
     done                                     = true;
+    done.notify_all();
     assert(result);
   }
 


        


More information about the libcxx-commits mailing list