#include "stdafx.h"
#include <windows.h>
#include <stdio.h>
#include <stdlib.h>
DWORD WINAPI func(LPVOID number)
{
printf("Thread number is %d\n",number);
return 0;
}
int _tmain(int argc, _TCHAR* argv[])
{
HANDLE hthread[10];
for(int i =0;i<10;i++)
{
int isStartNow = 0;
if(i == 5)
{
isStartNow = CREATE_SUSPENDED;
}
hthread[i] = CreateThread(NULL,0,func,(LPVOID)i,isStartNow,NULL);
}
Sleep(10);
ResumeThread(hthread[5]);
Sleep(10);
printf("Main thread starts");
return 0;
}