diff options
author | drumsetmonkey <abelleisle@roadrunner.com> | 2016-03-30 08:41:16 -0400 |
---|---|---|
committer | drumsetmonkey <abelleisle@roadrunner.com> | 2016-03-30 08:41:16 -0400 |
commit | c35571e37bdd6d2fe9b95e4265c150265585f3a9 (patch) | |
tree | 31478f777e27f345cc20f2eaf796a176b55cb4fe /include/threadpool.h | |
parent | 82c178d797b9a23c31d7dad1cc8cac29d27c6eb1 (diff) |
Inv and textures
Diffstat (limited to 'include/threadpool.h')
-rw-r--r-- | include/threadpool.h | 53 |
1 files changed, 0 insertions, 53 deletions
diff --git a/include/threadpool.h b/include/threadpool.h deleted file mode 100644 index c341673..0000000 --- a/include/threadpool.h +++ /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 |