线程控制
作者:互联网
三个函数的使用
1,WaitForSingleObject
#include <Windows.h> DWORD WINAPI MyThread(LPVOID lpParameter) { //ziji de code } int main() { HANDLE hThread; hThread = CreateThread(NULL,0,MyThread,NULL,0,NULL); CloseHandle(hThread); WaitForSingleObject(hThread,INFINITE);//等待hThread线程执行完毕再往下走 printf("hThread线程执行完毕。。。"); return 0; }
2,WaitForMultipleObjects
3,GetExitCodeThread
标签:控制,WaitForSingleObject,MyThread,完毕,线程,NULL,hThread 来源: https://www.cnblogs.com/a-s-m/p/12349632.html