pgLab/pglab/tsqueue.h
2017-12-26 07:28:18 +01:00

26 lines
399 B
C++

#ifndef TSQUEUE_H
#define TSQUEUE_H
//#include "Win32Event.h"
#include <deque>
#include <functional>
#include <mutex>
class TSQueue {
public:
using t_Callable = std::function<void()>;
TSQueue();
void add(t_Callable callable);
bool empty();
t_Callable pop();
private:
using t_CallableQueue = std::deque<t_Callable>;
std::mutex m;
t_CallableQueue futureQueue;
};
#endif // TSQUEUE_H