SMX_PGE/sdk/Windows/SMXHelperThread.h
Glenn Maynard d576545266 Split out low-level thread handling into SMXThread, and use it in SMXHelperThread.
This isn't used by the SMXManager thread for now.

This also separates out SMX::Event for thread event handling.
2018-12-09 16:10:45 -06:00

32 lines
565 B
C++

#ifndef SMXHelperThread_h
#define SMXHelperThread_h
#include "Helpers.h"
#include "SMXThread.h"
#include <functional>
#include <vector>
#include <memory>
using namespace std;
namespace SMX
{
class SMXHelperThread: public SMXThread
{
public:
SMXHelperThread(const string &sThreadName);
// Call func asynchronously from the helper thread.
void RunInThread(function<void()> func);
private:
void ThreadMain();
// Helper threads use their independent lock.
SMX::Mutex m_Lock;
vector<function<void()>> m_FunctionsToCall;
};
}
#endif