nbsdx / ThreadPool

Lightweight, Generic, Pure C++11 ThreadPool

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Purpose of introducing jobs_left

CheYulin opened this issue · comments

Hi nbsdx,
I am confused about the introduction of jobs_left.
What is the purpose of introducing atomic_int type jobs_left(in line 27)?
I think, we could simply add the queue_mutex's lock in function WaitAll() (in line 148), rather than using the atomic_int variable jobs_left?
So, what is your consideration here?

Best,
CHE Yulin

commented

If you would like to propose changes, submit a pull request.