diff --git a/test/unit/mt_reactor.cpp b/test/unit/mt_reactor.cpp index 0bf91c4c8..a5ba428fa 100644 --- a/test/unit/mt_reactor.cpp +++ b/test/unit/mt_reactor.cpp @@ -119,9 +119,11 @@ struct mt_reactor_test }; std::thread ra(slice), rb(slice); + // Yield while spinning: under Valgrind's serialized scheduler + // a tight spin starves the freshly created runner threads of + // their first slice, and the wait never completes. while (entered.load() < 2) - { - } + std::this_thread::yield(); for (int i = 0; i < 20; ++i) { // The counter travels as a parameter: a loop-scoped