摘要: /* productandconsumer. cpp */#include <windows.h>#include <stdio.h>#include <stdlib.h>typedef HANDLE Semaphore; //信号量的Windows 原型#define P(S) WaitForSingleObject (S, INFINITE) //定义P操作#define V(S) ReleaseSemaphore (S, 1, NULL) //定义V操作#define CONSUMER_NUM 10 /* 消费者个数*/#define PRODUCER 阅读全文
posted @ 2011-04-02 11:50 Cranny 阅读(1291) 评论(1) 推荐(0) 编辑