diff --git a/libapicore/ApiServer.cpp b/libapicore/ApiServer.cpp index 835e8bdfeb..2e6934b78c 100644 --- a/libapicore/ApiServer.cpp +++ b/libapicore/ApiServer.cpp @@ -268,8 +268,8 @@ void ApiServer::start() cnote << "Api server listening on port " + to_string(m_acceptor.local_endpoint().port()) << (m_password.empty() ? "." : ". Authentication needed."); - m_workThread = std::thread{boost::bind(&ApiServer::begin_accept, this)}; m_running.store(true, std::memory_order_relaxed); + m_workThread = std::thread{boost::bind(&ApiServer::begin_accept, this)}; } void ApiServer::stop()