|
|
1.1 ! root 1: #define MAX_ITEM 10 ! 2: #define MAX_SIZE 20 ! 3: ! 4: #define SUCCESS 1 ! 5: #define FAILURE 0 ! 6: ! 7: ! 8: #define MAXCALLS 20 ! 9: ! 10: ! 11: // Synchronization primitives to shared buffer ! 12: ! 13: HANDLE hMutex; // Handle to mutex ! 14: HANDLE hEmptySem; // Handle to empty semaphore ! 15: HANDLE hFullSem; // Handle to full semaphore ! 16: ! 17: ! 18: // This is the shared buffer ! 19: ! 20: char buffer[MAX_ITEM][MAX_SIZE]; ! 21: ! 22: ! 23: // The current producer and consumer position in the buffer pool ! 24: ! 25: int pro_buf_pos; ! 26: int con_buf_pos;
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.