diff options
author | drumsetmonkey <abelleisle@roadrunner.com> | 2016-04-28 10:46:38 -0400 |
---|---|---|
committer | drumsetmonkey <abelleisle@roadrunner.com> | 2016-04-28 10:46:38 -0400 |
commit | 68cb663a370747c325eeeeea66cca86803e4b8e5 (patch) | |
tree | b82b7b8d77ff2a3439e99d11589bbf1a3ef1f07c /include/threadpool.hpp | |
parent | 2e026aff928b30267a39ef6fdeec3e43e9f106e6 (diff) | |
parent | 174bcd3a415c21fc2c59a3af1b6333faa78b37d0 (diff) |
New inventory system
Diffstat (limited to 'include/threadpool.hpp')
-rw-r--r-- | include/threadpool.hpp | 53 |
1 files changed, 0 insertions, 53 deletions
diff --git a/include/threadpool.hpp b/include/threadpool.hpp deleted file mode 100644 index c341673..0000000 --- a/include/threadpool.hpp +++ /dev/null @@ -1,53 +0,0 @@ -#ifndef THREADPOOL_H -#define THREADPOOL_H - -#include <vector> -#include <queue> -#include <thread> -#include <mutex> -#include <condition_variable> -#include <iostream> -#include <unistd.h> - -using namespace std; - -class ThreadPool -{ -public: - - // Constructor. - ThreadPool(int threads); - - // Destructor. - ~ThreadPool(); - - // Adds task to a task queue. - void Enqueue(function<void()> f); - - // Shut down the pool. - void ShutDown(); - -private: - // Thread pool storage. - vector<thread> threadPool; - - // Queue to keep track of incoming tasks. - queue<function<void()>> tasks; - - // Task queue mutex. - mutex tasksMutex; - - // Condition variable. - condition_variable condition; - - // Indicates that pool needs to be shut down. - bool terminate; - - // Indicates that pool has been terminated. - bool stopped; - - // Function that will be invoked by our threads. - void Invoke(); -}; - -#endif //THRE
\ No newline at end of file |