From 3c62af2984bdccdf090cc34c171b8268d8fded5d Mon Sep 17 00:00:00 2001 From: jke000 Date: Thu, 9 Dec 2021 11:56:37 -0800 Subject: [PATCH] revert 68671fa ThreadPool changes --- CometSearch/ThreadPool.h | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/CometSearch/ThreadPool.h b/CometSearch/ThreadPool.h index 2a2559f4..a8e54572 100644 --- a/CometSearch/ThreadPool.h +++ b/CometSearch/ThreadPool.h @@ -332,7 +332,7 @@ inline void* threadStart(void* ptr) int i = data->thread_no; ThreadPool* tp = (ThreadPool*)data->tp; bool did_job = false; - while (&tp->jobs_) + while (1) { tp->LOCK(&tp->lock_); @@ -381,16 +381,7 @@ inline void* threadStart(void* ptr) else { //std::cerr << "Thread " << i << " does a job" << std::endl; - if (&tp->jobs_) - { - job = std::move (tp->jobs_.front ()); - } - else - { - tp->UNLOCK(&tp->lock_); - continue; - } - + job = std::move (tp->jobs_.front ()); tp->jobs_.pop_front(); if (!did_job)