windows 代码示例多线程

173 阅读1分钟

代码示例多线程

#include <Windows.h>

#include <stdio.h>

DWORD WINAPIThreadProc(LPVOID lpParam)

{

    printf("ThreadProc \r\n");

    return0;

}

int main(intargc,char*arvg[])

{

    HANDLE hThread = CreateThread(NULL,0,ThreadProc,NULL,0,NULL);

    WaitForSingleObject(hThread,1000);

    printf("main \r\n");

    CloseHandle(hThread);

    return0;

}