|
Last change
on this file since 8011 was 3208, checked in by sandervl, 26 years ago |
|
mutex + semaphore header updates
|
|
File size:
679 bytes
|
| Line | |
|---|
| 1 | /* $Id: vmutex.h,v 1.5 2000-03-23 19:25:09 sandervl Exp $ */
|
|---|
| 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 |
|
|---|
| 14 | #define VMUTEX_NONSHARED 0
|
|---|
| 15 | #define VMUTEX_SHARED 1
|
|---|
| 16 |
|
|---|
| 17 | #ifdef _OS2WIN_H
|
|---|
| 18 | #define HMTX DWORD
|
|---|
| 19 | #endif
|
|---|
| 20 |
|
|---|
| 21 | class VMutex
|
|---|
| 22 | {
|
|---|
| 23 | public:
|
|---|
| 24 | VMutex (int fShared = VMUTEX_NONSHARED, HMTX *phMutex = NULL);
|
|---|
| 25 | ~VMutex();
|
|---|
| 26 |
|
|---|
| 27 | public:
|
|---|
| 28 | VOID enter(ULONG timeout = VMUTEX_WAIT_FOREVER, HMTX *phMutex = NULL);
|
|---|
| 29 | VOID leave(HMTX *phMutex = NULL);
|
|---|
| 30 | int getNrBlocked() { return waiting; };
|
|---|
| 31 |
|
|---|
| 32 | protected:
|
|---|
| 33 | HMTX sem_handle;
|
|---|
| 34 | int waiting;
|
|---|
| 35 | BOOL fShared;
|
|---|
| 36 | };
|
|---|
| 37 |
|
|---|
| 38 | #endif
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.