From f8633c0c9217ed5499fdda391946d416c52e6809 Mon Sep 17 00:00:00 2001 From: Paul Adenot Date: Mon, 10 Mar 2025 15:18:35 +0100 Subject: [PATCH] Join thread before calling cond var dtor to avoid race --- test/test_resampler.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/test_resampler.cpp b/test/test_resampler.cpp index 5b5f7b56..dd60455f 100644 --- a/test/test_resampler.cpp +++ b/test/test_resampler.cpp @@ -1524,10 +1524,10 @@ TEST(cubeb, resampler_typical_uses) common_init(&ctx, "Cubeb resampler test"); size_t concurrency = std::max(1u, std::thread::hardware_concurrency()); - ThreadPool pool(concurrency); - std::mutex mutex; std::condition_variable cv; + std::mutex mutex; size_t task_count = 0; + ThreadPool pool(concurrency); for (int source_rate : rates) { for (int target_rate : rates) {