| 
            Last change
 on this file since 6003 was             3208, checked in by sandervl, 26 years ago           | 
        
        
          | 
             
mutex + semaphore header updates 
 
           | 
        
        
          | 
            File size:
            679 bytes
           | 
        
      
      
| Rev | Line |   | 
|---|
| [3208] | 1 | /* $Id: vmutex.h,v 1.5 2000-03-23 19:25:09 sandervl Exp $ */
 | 
|---|
| [4] | 2 | 
 | 
|---|
 | 3 | /*
 | 
|---|
 | 4 |  *
 | 
|---|
 | 5 |  * Project Odin Software License can be found in LICENSE.TXT
 | 
|---|
 | 6 |  *
 | 
|---|
 | 7 |  */
 | 
|---|
 | 8 | #ifndef __VMUTEX_H__
 | 
|---|
 | 9 | #define __VMUTEX_H__
 | 
|---|
 | 10 | 
 | 
|---|
 | 11 | #define VMUTEX_RETURN_IMM        0
 | 
|---|
 | 12 | #define VMUTEX_WAIT_FOREVER     -1
 | 
|---|
 | 13 | 
 | 
|---|
| [1430] | 14 | #define VMUTEX_NONSHARED         0
 | 
|---|
 | 15 | #define VMUTEX_SHARED            1
 | 
|---|
 | 16 | 
 | 
|---|
| [4] | 17 | #ifdef _OS2WIN_H
 | 
|---|
 | 18 | #define HMTX DWORD
 | 
|---|
 | 19 | #endif
 | 
|---|
 | 20 | 
 | 
|---|
 | 21 | class VMutex
 | 
|---|
 | 22 | {
 | 
|---|
 | 23 | public:
 | 
|---|
| [3208] | 24 |         VMutex (int fShared = VMUTEX_NONSHARED, HMTX *phMutex = NULL);
 | 
|---|
| [4] | 25 |        ~VMutex();
 | 
|---|
 | 26 | 
 | 
|---|
 | 27 | public:
 | 
|---|
| [3208] | 28 |         VOID enter(ULONG timeout = VMUTEX_WAIT_FOREVER, HMTX *phMutex = NULL);
 | 
|---|
 | 29 |         VOID leave(HMTX *phMutex = NULL);
 | 
|---|
| [4] | 30 |         int  getNrBlocked() { return waiting; };
 | 
|---|
 | 31 | 
 | 
|---|
 | 32 | protected:
 | 
|---|
 | 33 |         HMTX sem_handle;
 | 
|---|
 | 34 |         int  waiting;
 | 
|---|
| [3208] | 35 |         BOOL fShared;
 | 
|---|
| [4] | 36 | };
 | 
|---|
 | 37 | 
 | 
|---|
 | 38 | #endif
 | 
|---|
       
      
  Note:
 See   
TracBrowser
 for help on using the repository browser.