printf("\n");
}
}
thread_count--;
return 0;
}
int _tmain(int argc, _TCHAR* argv[])
{
thread_count = 4;
CreateThread(0, 0, thread_proc, 0, 0, 0);
CreateThread(0, 0, thread_proc, 0, 0, 0);
CreateThread(0, 0, thread_proc, 0, 0, 0);
CreateThread(0, 0, thread_proc, 0, 0, 0);
while (thread_count)
Sleep(0);
getchar();
DeleteCriticalSection(&g_cs);
return 0;
。
輸出:
ABCD...........Z
ABCD............Z
ABCD...........Z
ABCD............Z
ABCD...........Z
ABCD............Z
......................
相關(guān)推薦:
C++考試輔導(dǎo):內(nèi)存分配的五種方法的區(qū)別 2009年c++二級等考輔導(dǎo):char*和char[]的區(qū)別