Last change
on this file was 8203, checked in by sandervl, 23 years ago |
use critical sections in vmutex; change global vmutex in mmap to use a shared critical section
|
File size:
1.4 KB
|
Rev | Line | |
---|
[8203] | 1 | /* $Id: vmutex.cpp,v 1.10 2002-04-07 15:44:11 sandervl Exp $ */
|
---|
[100] | 2 |
|
---|
[4] | 3 | /*
|
---|
| 4 | * Mutex class
|
---|
| 5 | *
|
---|
[3206] | 6 | * Copyright 1998-2000 Sander van Leeuwen (sandervl@xs4all.nl)
|
---|
[4] | 7 | *
|
---|
[657] | 8 | *
|
---|
[3206] | 9 | * NOTE: When creating a shared mutex object, you must call the ctor, enter &
|
---|
| 10 | * leave with a 2nd parameter (HMTX *). This mutex handle must be located
|
---|
| 11 | * in the local data segment of the dll.
|
---|
| 12 | * This enables other processes than the one that created the mutex object
|
---|
| 13 | * to access it
|
---|
| 14 | *
|
---|
[657] | 15 | * Project Odin Software License can be found in LICENSE.TXT
|
---|
| 16 | *
|
---|
[4] | 17 | */
|
---|
[3206] | 18 | #define INCL_DOSSEMAPHORES
|
---|
| 19 | #define INCL_DOSERRORS
|
---|
[120] | 20 | #include <os2wrap.h> //Odin32 OS/2 api wrappers
|
---|
[8203] | 21 | #include <win32type.h>
|
---|
[4] | 22 | #include <vmutex.h>
|
---|
[8203] | 23 | #include <odincrt.h>
|
---|
[4] | 24 | #include <misc.h>
|
---|
| 25 |
|
---|
[2802] | 26 | #define DBG_LOCALLOG DBG_vmutex
|
---|
| 27 | #include "dbglocal.h"
|
---|
| 28 |
|
---|
[4] | 29 | /******************************************************************************/
|
---|
| 30 | /******************************************************************************/
|
---|
[8203] | 31 | VMutex::VMutex()
|
---|
[4] | 32 | {
|
---|
[8203] | 33 | DosInitializeCriticalSection(&critsect, NULL);
|
---|
[4] | 34 | }
|
---|
| 35 | /******************************************************************************/
|
---|
| 36 | /******************************************************************************/
|
---|
[657] | 37 | VMutex::~VMutex()
|
---|
[4] | 38 | {
|
---|
[8203] | 39 | DosDeleteCriticalSection(&critsect);
|
---|
[4] | 40 | }
|
---|
| 41 | /******************************************************************************/
|
---|
| 42 | /******************************************************************************/
|
---|
[3206] | 43 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.