home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 9 / IOPROG_9.ISO / contrib / iis4 / iis4_07.cab / ThreadPool.h < prev    next >
Encoding:
C/C++ Source or Header  |  1997-08-14  |  867 b   |  27 lines

  1. // ThreadPool.h - Header file declaring 
  2.  
  3. // Number of threads in pool
  4. #define POOL_THREADS 2
  5.  
  6. // Number of entries in ECBqueue
  7. #define WORK_QUEUE_ENTRIES 2
  8.  
  9. // Global critical section to control access to ECB queue
  10. CRITICAL_SECTION csQueueLock;
  11.  
  12. // Semaphore to wait on in worker thread; each time an ECB is added to the 
  13. // ECBqueue by HttpExtensionProc, the semaphore must be released once
  14. HANDLE hWorkSem;
  15.  
  16. // These functions will add/retrieve an ECB to/from the linked list.
  17. // ENTER csQueueLock BEFORE CALLING AND LEAVE csQueueLock AFTER
  18. //   RETURNING FROM THESE FUNCTIONS!!!
  19. BOOL AddWorkQueueEntry(EXTENSION_CONTROL_BLOCK *);
  20. BOOL GetWorkQueueEntry(EXTENSION_CONTROL_BLOCK ** ppECB);
  21.  
  22. // This function initializes the thread pool
  23. BOOL InitThreadPool(void);
  24.  
  25. // Function that threads in pool run
  26. DWORD WINAPI WorkerFunction(LPVOID); 
  27.