/************************************
* *
* 一个生产者与5个消费者 * *
* *
*************************************/
#include "stdafx.h"
#include <time.h>
#include <windows.h>
#include <iostream>
using namespace std;
DWORD WINAPI Cusumer6(LPVOID IpParameter);
void RunTaskMultiThread(int Threadnum);
long int i;
DWORD id[5];
DWORD * idthreads;
HANDLE hMutex;
HANDLE * threads;
int main()
{
HANDLE hThread;
hThread = CreateThread(NULL, 0, Cusumer6, NULL, 0, NULL);
hMutex = CreateMutex(NULL, FALSE, NULL);
RunTaskMultiThread(5);
while (true);
return 0;
}
DWORD WINAPI Cusumer6(LPVOID IpParameter)
本内容试读结束,登录后可阅读更多
下载后可阅读完整内容,剩余2页未读,立即下载