home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / baclsema.zip / IPCMUTEX.H < prev    next >
C/C++ Source or Header  |  1994-06-23  |  1KB  |  49 lines

  1. // ****************************************************************************
  2. //
  3. // Module:  ipcmutex.h
  4. // Author:  Dick Lam
  5. //
  6. // Purpose: C++ class header file for ipcMutexSemaphore
  7. //
  8. // Notes:  This class is derived from ipcSemaphore.  It is an interface class
  9. //         for mutex semaphores that can be used to control access to a shared
  10. //         resource across processes or threads.
  11. //
  12. // ****************************************************************************
  13.  
  14. #ifndef MODULE_ipcMutexSemaphoreh
  15. #define MODULE_ipcMutexSemaphoreh
  16.  
  17. #include "ipcsem.h"
  18.  
  19. // class declaration
  20. class EXPORT ipcMutexSemaphore : public ipcSemaphore {
  21.  
  22. public:
  23.  
  24.    // constructor and destructor
  25.    ipcMutexSemaphore(const char *name, ipcSemaphoreOp operation = semcreate);
  26.    virtual ~ipcMutexSemaphore();
  27.  
  28.    // query method for number of requests made
  29.    virtual unsigned long Query();
  30.  
  31.    // request and release methods (to lock and unlock resources)
  32.    virtual void Request();
  33.    virtual void Release();
  34.  
  35. private:
  36.  
  37.    // private copy constructor and operator= (define these and make them
  38.    // public to enable copy and assignment of the class)
  39.    ipcMutexSemaphore(const ipcMutexSemaphore&);
  40.    ipcMutexSemaphore& operator=(const ipcMutexSemaphore&);
  41.  
  42. };
  43.  
  44. #endif
  45.  
  46. // ****************************************************************************
  47.  
  48. // end of ipcmutex.h
  49.