initial commit
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
#ifndef HYDRATHREAD
|
||||
#define HYDRATHREAD
|
||||
|
||||
#include "../engine/HydraObject.h"
|
||||
#include <thread>
|
||||
#include <string>
|
||||
#include <mutex>
|
||||
#include <condition_variable>
|
||||
|
||||
class CLASS_DEFINE HydraThread : public HydraObject
|
||||
{
|
||||
private:
|
||||
std::thread m_thread;
|
||||
bool m_running = false;
|
||||
|
||||
protected:
|
||||
virtual void Initialise() {};
|
||||
virtual void Process();
|
||||
public:
|
||||
std::string ThreadName = "";
|
||||
std::mutex ThreadLock;
|
||||
std::condition_variable WaitCondition;
|
||||
std::thread::id ThreadID;
|
||||
HydraThreadAffinity ThreadAffinity = HydraThreadAffinity::General;
|
||||
void RunLoop();
|
||||
void Start();
|
||||
void Stop();
|
||||
|
||||
|
||||
};
|
||||
|
||||
#endif /* HYDRATHREAD */
|
||||
Reference in New Issue
Block a user