From d286958c353e01e5fb3025870492916f775085d9 Mon Sep 17 00:00:00 2001 From: Craig Edwards Date: Sat, 16 Nov 2024 17:58:01 +0000 Subject: [PATCH] remove jthread, c++20 only --- include/dpp/cluster.h | 3 ++- src/dpp/cluster.cpp | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/include/dpp/cluster.h b/include/dpp/cluster.h index ceb3435458..baf1f98a6b 100644 --- a/include/dpp/cluster.h +++ b/include/dpp/cluster.h @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include @@ -182,7 +183,7 @@ class DPP_EXPORT cluster { * @brief Used to spawn the socket engine into its own thread if * the cluster is started with dpp::st_return. It is unused otherwise. */ - std::unique_ptr engine_thread{nullptr}; + std::unique_ptr engine_thread{nullptr}; public: /** diff --git a/src/dpp/cluster.cpp b/src/dpp/cluster.cpp index 77db08cddb..88605ce256 100644 --- a/src/dpp/cluster.cpp +++ b/src/dpp/cluster.cpp @@ -301,10 +301,10 @@ void cluster::start(bool return_after) { }); if (return_after) { - engine_thread = std::make_unique(std::jthread([event_loop]() { + engine_thread = std::make_unique([event_loop]() { dpp::utility::set_thread_name("event_loop"); event_loop(); - })); + }); } else { event_loop(); }