mirror of
https://github.com/bitcoin/bitcoin.git
synced 2024-11-20 10:38:42 +01:00
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>
This commit is contained in:
parent
b1c2370dde
commit
f94665466e
@ -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();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user