progschj / ThreadPool

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

Why not use atomic operations for “bool stop” #54

Closed jellynian closed 6 years ago

jellynian commented 6 years ago

    std::mutex queue_mutex;
    std::condition_variable condition;
       bool stop;
};

Why not use atomic operations for “bool stop” such as: std::atomic<bool> stop(false);