aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2018-02-06 20:32:33 +0100
committerWladimir J. van der Laan <laanwj@gmail.com>2018-02-06 20:32:51 +0100
commitf94665466ed50e868c98b1a1c708ad5767727bb6 (patch)
treecd933a3e7b4e3e3930ec37bb6651dc6523ebb3aa
parentb1c2370dde9ade180c638e5d9a4797f085322b5b (diff)
http: Remove WaitExit from WorkQueue
This function, which waits for all threads to exit, is no longer needed now that threads are joined instead. Signed-off-by: Wladimir J. van der Laan <laanwj@gmail.com>
-rw-r--r--src/httpserver.cpp11
1 files changed, 1 insertions, 10 deletions
diff --git a/src/httpserver.cpp b/src/httpserver.cpp
index a554dcb097..5000b0e245 100644
--- a/src/httpserver.cpp
+++ b/src/httpserver.cpp
@@ -99,8 +99,7 @@ public:
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 @@ public:
running = false;
cond.notify_all();
}
- /** Wait for worker threads to exit */
- void WaitExit()
- {
- std::unique_lock<std::mutex> 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();
}