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(); }