diff --git a/src/httpserver.cpp b/src/httpserver.cpp index a554dcb097166..5000b0e2455df 100644 --- a/src/httpserver.cpp +++ b/src/httpserver.cpp @@ -99,8 +99,7 @@ class WorkQueue numThreads(0) { } - /** Precondition: worker threads have all stopped - * (call WaitExit) + /** Precondition: worker threads have all stopped (they have been joined). */ ~WorkQueue() { @@ -141,13 +140,6 @@ class WorkQueue running = false; cond.notify_all(); } - /** Wait for worker threads to exit */ - void WaitExit() - { - std::unique_lock lock(cs); - while (numThreads > 0) - cond.wait(lock); - } }; struct HTTPPathHandler @@ -486,7 +478,6 @@ void StopHTTPServer() LogPrint(BCLog::HTTP, "Stopping HTTP server\n"); if (workQueue) { LogPrint(BCLog::HTTP, "Waiting for HTTP worker threads to exit\n"); - workQueue->WaitExit(); for (auto& thread: g_thread_http_workers) { thread.join(); }