forked from xNVSE/NVSE
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIThread.h
More file actions
32 lines (24 loc) · 642 Bytes
/
Copy pathIThread.h
File metadata and controls
32 lines (24 loc) · 642 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#pragma once
// TODO: I really don't like the interface for this
class IThread
{
public:
typedef void (* MainProcPtr)(void * param);
IThread();
~IThread();
void Start(MainProcPtr proc, void * procParam = NULL);
void Stop(void);
void ForceStop(void);
bool IsRunning(void) { return isRunning; }
bool StopRequested(void) { return stopRequested; }
HANDLE GetHandle(void) { return theThread; }
protected:
MainProcPtr mainProc;
void * mainProcParam;
volatile bool stopRequested;
bool isRunning;
HANDLE theThread;
UInt32 threadID;
private:
static UInt32 WINAPI _ThreadProc(void * param);
};