多线程编程基础

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include <windows.h>
#include <stdio.h>

DWORD WINAPI ThreadProc(LPVOID lpParam)
{
printf("ThreadProc \r\n");
return 0;
}

int main()
{
HANDLE hThread = CreateThread(NULL,0,ThreadProc,NULL,0,NULL);

WaitForSingleObject(hThread, INFINITE);

printf("main \r\n");

CloseHandle(hThread);

return 0;
}
------ 本文结束------
分享
分享