Merge bd5ec7c528 into merged_master (Bitcoin PR #19006)

This commit is contained in:
Andrew Poelstra 2020-11-26 01:08:46 +00:00
commit e1d89a5742
3 changed files with 21 additions and 21 deletions

View file

@ -422,7 +422,7 @@ bool UpdateHTTPServerLogging(bool enable) {
#endif
}
static std::thread threadHTTP;
static std::thread g_thread_http;
static std::vector<std::thread> g_thread_http_workers;
void StartHTTPServer()
@ -430,7 +430,7 @@ void StartHTTPServer()
LogPrint(BCLog::HTTP, "Starting HTTP server\n");
int rpcThreads = std::max((long)gArgs.GetArg("-rpcthreads", DEFAULT_HTTP_THREADS), 1L);
LogPrintf("HTTP: starting %d worker threads\n", rpcThreads);
threadHTTP = std::thread(ThreadHTTP, eventBase);
g_thread_http = std::thread(ThreadHTTP, eventBase);
for (int i = 0; i < rpcThreads; i++) {
g_thread_http_workers.emplace_back(HTTPWorkQueueRun, workQueue, i);
@ -468,7 +468,7 @@ void StopHTTPServer()
boundSockets.clear();
if (eventBase) {
LogPrint(BCLog::HTTP, "Waiting for HTTP event thread to exit\n");
threadHTTP.join();
if (g_thread_http.joinable()) g_thread_http.join();
}
if (eventHTTP) {
evhttp_free(eventHTTP);