Skip to content

Commit

Permalink
revert 68671fa ThreadPool changes
Browse files Browse the repository at this point in the history
  • Loading branch information
jke000 committed Dec 9, 2021
1 parent e08d5ed commit 3c62af2
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions CometSearch/ThreadPool.h
Original file line number Diff line number Diff line change
Expand Up @@ -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_);

Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 3c62af2

Please sign in to comment.