Skip to content

Commit e140aba

Browse files
huixie90zahiraam
authored andcommitted
[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.
1 parent 2cbe4e4 commit e140aba

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ int main(int, char**) {
4545
const std::jthread jt{[&done] { done.wait(false); }};
4646
std::same_as<bool> decltype(auto) result = jt.joinable();
4747
done = true;
48+
done.notify_all();
4849
assert(result);
4950
}
5051

0 commit comments

Comments
 (0)