diff --git a/test/blackbox/common/BlackboxTestsTransportSHM.cpp b/test/blackbox/common/BlackboxTestsTransportSHM.cpp index 9bb96644c2a..6b53a6598dd 100644 --- a/test/blackbox/common/BlackboxTestsTransportSHM.cpp +++ b/test/blackbox/common/BlackboxTestsTransportSHM.cpp @@ -116,16 +116,19 @@ TEST(SHM, IgnoreNonExistentSegment) // Create and quickly destroy several participants in several threads #ifdef _WIN32 constexpr size_t num_threads = 1; - constexpr size_t num_parts = 2; #else constexpr size_t num_threads = 10; - constexpr size_t num_parts = 10; #endif // _WIN32 std::vector threads; for (size_t i = 0; i < num_threads; i++) { - threads.push_back(std::thread([num_parts]() + threads.push_back(std::thread([]() { +#ifdef _WIN32 + constexpr size_t num_parts = 2; +#else + constexpr size_t num_parts = 10; +#endif // _WIN32 for (size_t i = 0; i < num_parts; ++i) { PubSubWriter late_writer(TEST_TOPIC_NAME);