我们先来看一个简单的程序:
#include <stdio.h>
#include <windows.h>
DWORD WINAPI ThreadFun(LPVOID pM)
{
printf("%s\n", pM);
return 0;
}
int main()
{
printf("main thread\n");
HANDLE handle = CreateThread(NULL, 0, ThreadFun, "hello world", 0, NULL);
CloseHandle(handle);
Sleep(2000);
return 0;
}#include <stdio.h>
#inc