File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.wait Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change 1717#include < functional>
1818#include < thread>
1919#include < vector>
20+ #include < iostream>
2021
2122#include " make_test_thread.h"
2223
@@ -25,6 +26,7 @@ constexpr int num_iterations = 10'000;
2526
2627int main (int , char **) {
2728 for (int run = 0 ; run < 20 ; ++run) {
29+ std::cerr << " run " << run << std::endl;
2830 std::atomic<int > waiter_ready (0 );
2931 std::atomic<int > state (0 );
3032
@@ -38,8 +40,11 @@ int main(int, char**) {
3840
3941 auto notify = [&] {
4042 for (int i = 0 ; i < num_iterations; ++i) {
43+ if (i % 1000 == 0 )
44+ std::cerr << " run " << run << " notify iteration " << i << std::endl;
45+
4146 while (waiter_ready.load () < num_waiters) {
42- std::this_thread::yield ();
47+ // std::this_thread::yield();
4348 }
4449 waiter_ready.store (0 );
4550 state.fetch_add (1 );
You can’t perform that action at this time.
0 commit comments