#include <Windows.h>
#include <process.h>
#include <stdio.h>
#include <stdlib.h>
void acceptThread(void *)
{
for(int j = 0 ;j < 4 ;j ++)
{
Sleep(100);
printf("this is the second thread !\n");
}
}
int main()
{
_beginthread(acceptThread ,NULL ,0);
for(int j = 0 ;j < 4 ;j ++)
{
Sleep(200);
printf("this is the first thread !\n");
}
return 0;
}
多线程简单例子
最新推荐文章于 2022-08-10 15:24:24 发布