- methods to expand tilda in file pathes + methods to control thread pool
This commit is contained in:
@@ -18,11 +18,12 @@ class thread_pool
|
||||
public:
|
||||
typedef std::function<void()> task;
|
||||
|
||||
thread_pool(size_t num_of_threads, const std::string&);
|
||||
thread_pool(size_t num_of_threads, const std::string& thread_name);
|
||||
~thread_pool();
|
||||
|
||||
void enqueue(const task& task);
|
||||
|
||||
void wait(std::chrono::milliseconds interval = std::chrono::milliseconds(50));
|
||||
size_t size();
|
||||
private:
|
||||
// need to keep track of threads so we can join them
|
||||
std::vector< std::thread > workers;
|
||||
@@ -33,7 +34,7 @@ private:
|
||||
// synchronization
|
||||
std::mutex queue_mutex;
|
||||
std::condition_variable condition;
|
||||
bool stop = false;
|
||||
std::atomic_bool stop = false;
|
||||
|
||||
// thread name prefix for worker threads
|
||||
std::string name;
|
||||
|
||||
Reference in New Issue
Block a user