| 426 | static std::vector<std::thread> g_thread_http_workers; |
| 427 | |
| 428 | bool StartHTTPServer() |
| 429 | { |
| 430 | LogPrint("http", "Starting HTTP server\n"); |
| 431 | int rpcThreads = std::max((long)GetArg("-rpcthreads", DEFAULT_HTTP_THREADS), 1L); |
| 432 | LogPrintf("HTTP: starting %d worker threads\n", rpcThreads); |
| 433 | std::packaged_task<bool(event_base*)> task(ThreadHTTP); |
| 434 | threadResult = task.get_future(); |
| 435 | threadHTTP = std::thread(std::move(task), eventBase); |
| 436 | |
| 437 | for (int i = 0; i < rpcThreads; i++) { |
| 438 | g_thread_http_workers.emplace_back(HTTPWorkQueueRun, workQueue); |
| 439 | } |
| 440 | return true; |
| 441 | } |
| 442 | |
| 443 | void InterruptHTTPServer() |
| 444 | { |
no test coverage detected