aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--vespalib/src/tests/coro/lazy/lazy_test.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/vespalib/src/tests/coro/lazy/lazy_test.cpp b/vespalib/src/tests/coro/lazy/lazy_test.cpp
index 3141d7a5363..b838152249e 100644
--- a/vespalib/src/tests/coro/lazy/lazy_test.cpp
+++ b/vespalib/src/tests/coro/lazy/lazy_test.cpp
@@ -12,9 +12,12 @@ using vespalib::coro::Lazy;
using vespalib::coro::sync_wait;
std::mutex thread_lock;
-std::vector<std::jthread> threads;
+std::vector<std::thread> threads;
struct JoinThreads {
~JoinThreads() {
+ for (auto &thread: threads) {
+ thread.join();
+ }
threads.clear();
}
};
@@ -24,7 +27,7 @@ auto run_in_other_thread() {
bool await_ready() const noexcept { return false; }
void await_suspend(std::coroutine_handle<> handle) const {
auto guard = std::lock_guard(thread_lock);
- threads.push_back(std::jthread(handle));
+ threads.push_back(std::thread(handle));
}
void await_resume() const noexcept {}
};