project64/Source/Project64/UserInterface/Debugger/ScriptWorker.h

29 lines
615 B
C
Raw Normal View History

#include <windows.h>
#pragma once
class CScriptInstance;
class CScriptWorker
{
private:
bool m_bStopping;
bool m_bRegistered;
2022-09-26 02:31:54 +00:00
static DWORD WINAPI ThreadProc(void * _this);
public:
2022-09-26 02:31:54 +00:00
CScriptWorker(CScriptInstance * instance, void * dukObjectHeapPtr);
virtual ~CScriptWorker();
void StartWorkerProc();
virtual void StopWorkerProc();
protected:
2022-09-26 02:31:54 +00:00
CScriptInstance * m_Instance;
void * m_DukObjectHeapPtr;
CriticalSection m_CS;
HANDLE m_hThread;
// Implementation should return when StopRequested() is true
virtual void WorkerProc() = 0;
bool StopRequested();
};