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> zcash: cherry picked from commit f94665466ed50e868c98b1a1c708ad5767727bb6 zcash: https://github.com/bitcoin/bitcoin/pull/12366
This commit is contained in:
parent
0dcbfc9147
commit
c733ded07d
|
@ -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);
|
||||
}
|
||||
|
||||
/** Return current depth of queue */
|
||||
size_t Depth()
|
||||
|
@ -490,7 +482,6 @@ void StopHTTPServer()
|
|||
LogPrint("http", "Stopping HTTP server\n");
|
||||
if (workQueue) {
|
||||
LogPrint("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