ReactOS
0.4.16-dev-1093-g93e9710
Toggle main menu visibility
Main Page
Related Pages
Modules
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
x
Functions
_
a
b
c
d
e
f
g
h
i
l
m
o
p
r
s
t
u
v
w
Variables
_
c
d
e
f
g
h
i
l
m
n
o
p
s
t
u
x
Typedefs
_
a
b
c
d
e
f
g
h
i
l
m
o
p
r
s
t
u
v
w
x
Enumerations
_
a
b
c
d
f
i
l
m
o
p
s
t
w
x
Enumerator
a
b
c
d
e
f
g
h
i
m
n
o
p
r
s
t
u
v
w
x
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerations
_
a
b
c
d
e
f
h
i
k
l
m
n
o
p
r
s
t
u
v
w
z
Enumerator
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Properties
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Related Functions
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
q
r
s
t
v
x
Files
File List
File Members
All
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Variables
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerations
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Enumerator
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Macros
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Examples
cicmutex.h
Go to the documentation of this file.
1
/*
2
* PROJECT: ReactOS Cicero
3
* LICENSE: LGPL-2.1-or-later (https://spdx.org/licenses/LGPL-2.1-or-later)
4
* PURPOSE: Cicero mutex handling
5
* COPYRIGHT: Copyright 2023 Katayama Hirofumi MZ <katayama.hirofumi.mz@gmail.com>
6
*/
7
8
#pragma once
9
10
#include "
cicbase.h
"
11
12
class
CicMutex
13
{
14
HANDLE
m_hMutex
;
15
BOOL
m_bInit
;
16
17
public
:
18
CicMutex
() :
m_hMutex
(
NULL
),
m_bInit
(
FALSE
)
19
{
20
}
21
~CicMutex
()
22
{
23
Uninit
();
24
}
25
26
void
Init
(
LPSECURITY_ATTRIBUTES
lpSA,
LPCTSTR
pszMutexName)
27
{
28
m_hMutex
=
::CreateMutex
(lpSA,
FALSE
, pszMutexName);
29
m_bInit
=
TRUE
;
30
}
31
void
Uninit
()
32
{
33
if
(
m_hMutex
)
34
{
35
::CloseHandle
(
m_hMutex
);
36
m_hMutex
=
NULL
;
37
}
38
m_bInit
=
FALSE
;
39
}
40
41
BOOL
Enter
()
42
{
43
DWORD
dwWait =
::WaitForSingleObject
(
m_hMutex
, 5000);
44
return
(dwWait ==
WAIT_OBJECT_0
) || (dwWait ==
WAIT_ABANDONED
);
45
}
46
void
Leave
()
47
{
48
::ReleaseMutex
(
m_hMutex
);
49
}
50
};
cicbase.h
CicMutex
Definition:
cicmutex.h:13
CicMutex::Uninit
void Uninit()
Definition:
cicmutex.h:31
CicMutex::~CicMutex
~CicMutex()
Definition:
cicmutex.h:21
CicMutex::Init
void Init(LPSECURITY_ATTRIBUTES lpSA, LPCTSTR pszMutexName)
Definition:
cicmutex.h:26
CicMutex::m_bInit
BOOL m_bInit
Definition:
cicmutex.h:15
CicMutex::Leave
void Leave()
Definition:
cicmutex.h:46
CicMutex::m_hMutex
HANDLE m_hMutex
Definition:
cicmutex.h:14
CicMutex::CicMutex
CicMutex()
Definition:
cicmutex.h:18
CicMutex::Enter
BOOL Enter()
Definition:
cicmutex.h:41
NULL
#define NULL
Definition:
types.h:112
TRUE
#define TRUE
Definition:
types.h:120
FALSE
#define FALSE
Definition:
types.h:117
CloseHandle
#define CloseHandle
Definition:
compat.h:739
BOOL
unsigned int BOOL
Definition:
ntddk_ex.h:94
DWORD
unsigned long DWORD
Definition:
ntddk_ex.h:95
void
Definition:
nsiface.idl:2307
_SECURITY_ATTRIBUTES
Definition:
compat.h:191
WaitForSingleObject
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition:
synch.c:82
ReleaseMutex
BOOL WINAPI DECLSPEC_HOTPATCH ReleaseMutex(IN HANDLE hMutex)
Definition:
synch.c:618
WAIT_ABANDONED
#define WAIT_ABANDONED
Definition:
winbase.h:438
CreateMutex
#define CreateMutex
Definition:
winbase.h:3787
WAIT_OBJECT_0
#define WAIT_OBJECT_0
Definition:
winbase.h:432
LPCTSTR
const CHAR * LPCTSTR
Definition:
xmlstorage.h:193
sdk
lib
cicero
cicmutex.h
Generated on Mon May 5 2025 06:14:06 for ReactOS by
1.9.6