progschj / ThreadPool

A simple C++11 Thread Pool implementation
zlib License
7.63k stars 2.21k forks source link

Why doesn't ThreadPool be designed to thread-safe? #86

Closed cmf41013 closed 3 years ago

cmf41013 commented 3 years ago

Because the task maybe need to be added in multi-threads In some cases. I find the "ThreadPool::enqueue" function is not thread-safe, why?

cmf41013 commented 3 years ago

Sorry, it's thread-safe.

aorandexiaohai commented 3 years ago

Are you kidding?