|
Last change
on this file since 21695 was 8203, checked in by sandervl, 24 years ago |
|
use critical sections in vmutex; change global vmutex in mmap to use a shared critical section
|
|
File size:
1.4 KB
|
| Line | |
|---|
| 1 | /* $Id: vmutex.cpp,v 1.10 2002-04-07 15:44:11 sandervl Exp $ */
|
|---|
| 2 |
|
|---|
| 3 | /*
|
|---|
| 4 | * Mutex class
|
|---|
| 5 | *
|
|---|
| 6 | * Copyright 1998-2000 Sander van Leeuwen (sandervl@xs4all.nl)
|
|---|
| 7 | *
|
|---|
| 8 | *
|
|---|
| 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 | *
|
|---|
| 15 | * Project Odin Software License can be found in LICENSE.TXT
|
|---|
| 16 | *
|
|---|
| 17 | */
|
|---|
| 18 | #define INCL_DOSSEMAPHORES
|
|---|
| 19 | #define INCL_DOSERRORS
|
|---|
| 20 | #include <os2wrap.h> //Odin32 OS/2 api wrappers
|
|---|
| 21 | #include <win32type.h>
|
|---|
| 22 | #include <vmutex.h>
|
|---|
| 23 | #include <odincrt.h>
|
|---|
| 24 | #include <misc.h>
|
|---|
| 25 |
|
|---|
| 26 | #define DBG_LOCALLOG DBG_vmutex
|
|---|
| 27 | #include "dbglocal.h"
|
|---|
| 28 |
|
|---|
| 29 | /******************************************************************************/
|
|---|
| 30 | /******************************************************************************/
|
|---|
| 31 | VMutex::VMutex()
|
|---|
| 32 | {
|
|---|
| 33 | DosInitializeCriticalSection(&critsect, NULL);
|
|---|
| 34 | }
|
|---|
| 35 | /******************************************************************************/
|
|---|
| 36 | /******************************************************************************/
|
|---|
| 37 | VMutex::~VMutex()
|
|---|
| 38 | {
|
|---|
| 39 | DosDeleteCriticalSection(&critsect);
|
|---|
| 40 | }
|
|---|
| 41 | /******************************************************************************/
|
|---|
| 42 | /******************************************************************************/
|
|---|
| 43 |
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.