-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCThread.cpp
More file actions
76 lines (62 loc) · 1.24 KB
/
CThread.cpp
File metadata and controls
76 lines (62 loc) · 1.24 KB
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#include "CThread.h"
CNRLock::CNRLock(void)
{
hMutex = CreateMutex(NULL, FALSE, TEXT("_tmp_mutex_lock_")); //Create Mutex
WaitForSingleObject(hMutex, INFINITE); //加锁
}
CNRLock::~CNRLock(void)
{
ReleaseMutex(hMutex); //解锁
CloseHandle(hMutex);
}
HANDLE CNRThread::Create(LPVOID lpParameter, DWORD dwInitialState, DWORD dwCreationFlag ) //Create thread
{
dwState |= dwInitialState;
this->lpParameter = lpParameter;
if (dwState & STATE_ALIVE)
{
return hThread;
}
hThread = CreateThread(NULL, 0, StartAddress, this, dwCreationFlag, &dwThreadID);
dwState |= STATE_ALIVE;
if (dwState & STATE_CONTINUOUS)
{
hEvent = CreateEvent(NULL, TRUE, FALSE, TEXT("_tmp_event_"));
}
return hThread;
}
void CNRThread::Join(DWORD dwWaitInterval = INFINITE) // 设置进程状态
{
}
DWORD CNRThread::Suspend() //阻塞状态
{
}
DWORD CNRThread::Resume() //就绪状态
{
}
void CNRThread::SetUserData(void* lpUserData) //用户属性
{
}
void* CNRThread::GetUserData() const
{
}
DWORD CNRThread::GetID() const //线程ID
{
return dwThreadID;
}
HANDLE CNRThread::GetHandle() const //线程句柄
{
return hThread;
}
DWORD CNRThread::GetAsync() const //
{
}
DWORD CNRThread::GetState() const
{
}
void CNRThread::SetState(DWORD dwNewState)
{
}
BOOL CNRThread::Alert()//
{
}