Added Development information for me to dont forget things xD

Added AllAndMe DistributionType
Added a ThreadPool class
Added VoidNetClientAPI
This commit is contained in:
xX-TheDoctor-Xx
2016-07-18 01:13:20 +01:00
parent 72aa8ee0c4
commit a211400964
23 changed files with 323 additions and 32 deletions

33
include/ThreadPool.hpp Normal file
View File

@ -0,0 +1,33 @@
#ifndef THREAD_POOL_HPP
#define THREAD_POOL_HPP
#ifdef _MSC_VER
#pragma once
#endif
#include <vector>
#include <queue>
#include <thread>
#include <mutex>
#include <condition_variable>
class ThreadPool
{
public:
ThreadPool(int threads);
~ThreadPool();
void Enqueue(std::function<void()> f);
void Shutdown();
const ThreadPool &operator=(ThreadPool &pool);
private:
std::vector<std::thread> threadPool;
std::queue<std::function<void()>> tasks;
std::mutex tasksMutex;
std::condition_variable condition;
bool terminate;
bool stopped;
void Invoke();
};
#endif