Closed ztf512 closed 2 years ago
析构的时候stop=true并唤醒所有线程,然后在所有任务完成(tasks.empty())的时候return
if(this->stop && this->tasks.empty()) return;
析构的时候stop=true并唤醒所有线程,然后在所有任务完成(tasks.empty())的时候return
if(this->stop && this->tasks.empty()) return;
懂了,谢谢老哥
I just can't understand when this for loop ends: for(;;) // line 41
I would like to ask, why do I need this line of code?
I just can't understand when this for loop ends: for(;;) // line 41
I would like to ask, why do I need this line of code?
为了让worker thread不断循环做取任务、执行的操作,不然worker会在执行一个task之后结束
I just can't understand when this for loop ends: for(;;) // line 41