ReactOS
0.4.16-dev-1007-g2e85425
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
event.c
Go to the documentation of this file.
1
#include <windows.h>
2
#include <stdio.h>
3
4
HANDLE
events
[2];
5
6
DWORD
WINAPI
thread
(
LPVOID
crap )
7
{
8
SetEvent
(
events
[0] );
9
if
( crap )
10
SetEvent
(
events
[1] );
11
return
1;
12
}
13
14
int
main
(
void
)
15
{
16
DWORD
id
,
Status
;
17
printf
(
"Creating events\n"
);
18
events
[0] =
CreateEvent
( 0,
TRUE
,
FALSE
, 0 );
19
events
[1] =
CreateEvent
( 0,
TRUE
,
FALSE
, 0 );
20
printf
(
"Created events\n"
);
21
CreateThread
( 0, 0,
thread
, 0, 0, &
id
);
22
printf
(
"WaitForSingleObject %s\n"
, (
WaitForSingleObject
(
events
[0],
INFINITE
) ==
WAIT_OBJECT_0
?
"worked"
:
"failed"
) );
23
ResetEvent
(
events
[0] );
24
CreateThread
( 0, 0,
thread
, 0, 0, &
id
);
25
printf
(
"WaitForMultipleObjects with waitall = FALSE %s\n"
, (
WaitForMultipleObjects
( 2,
events
,
FALSE
,
INFINITE
) ==
WAIT_OBJECT_0
?
"worked"
:
"failed"
) );
26
ResetEvent
(
events
[0] );
27
CreateThread
( 0, 0,
thread
, (
void
*)1, 0, &
id
);
28
Status
=
WaitForMultipleObjects
( 2,
events
,
TRUE
,
INFINITE
);
29
printf
(
"WaitForMultipleObjects with waitall = TRUE %s\n"
, (
Status
==
WAIT_OBJECT_0
||
Status
==
WAIT_OBJECT_0
+ 1 ?
"worked"
:
"failed"
) );
30
ResetEvent
(
events
[0] );
31
printf
(
"WaitForSingleObject with timeout %s\n"
, (
WaitForSingleObject
(
events
[0], 100 ) ==
WAIT_TIMEOUT
?
"worked"
:
"failed"
) );
32
return
0;
33
}
thread
static HANDLE thread
Definition:
service.c:33
WAIT_TIMEOUT
#define WAIT_TIMEOUT
Definition:
dderror.h:14
TRUE
#define TRUE
Definition:
types.h:120
FALSE
#define FALSE
Definition:
types.h:117
CreateThread
HANDLE WINAPI DECLSPEC_HOTPATCH CreateThread(IN LPSECURITY_ATTRIBUTES lpThreadAttributes, IN DWORD dwStackSize, IN LPTHREAD_START_ROUTINE lpStartAddress, IN LPVOID lpParameter, IN DWORD dwCreationFlags, OUT LPDWORD lpThreadId)
Definition:
thread.c:137
INFINITE
#define INFINITE
Definition:
serial.h:102
DWORD
unsigned long DWORD
Definition:
ntddk_ex.h:95
printf
#define printf
Definition:
freeldr.h:97
Status
Status
Definition:
gdiplustypes.h:25
id
GLuint id
Definition:
glext.h:5910
void
Definition:
nsiface.idl:2307
events
HANDLE events[2]
Definition:
event.c:4
main
int main(void)
Definition:
event.c:14
WaitForMultipleObjects
DWORD WINAPI WaitForMultipleObjects(IN DWORD nCount, IN CONST HANDLE *lpHandles, IN BOOL bWaitAll, IN DWORD dwMilliseconds)
Definition:
synch.c:151
WaitForSingleObject
DWORD WINAPI WaitForSingleObject(IN HANDLE hHandle, IN DWORD dwMilliseconds)
Definition:
synch.c:82
SetEvent
BOOL WINAPI DECLSPEC_HOTPATCH SetEvent(IN HANDLE hEvent)
Definition:
synch.c:733
ResetEvent
BOOL WINAPI DECLSPEC_HOTPATCH ResetEvent(IN HANDLE hEvent)
Definition:
synch.c:714
CreateEvent
#define CreateEvent
Definition:
winbase.h:3779
WAIT_OBJECT_0
#define WAIT_OBJECT_0
Definition:
winbase.h:432
WINAPI
#define WINAPI
Definition:
msvc.h:6
modules
rostests
tests
event
event.c
Generated on Fri Apr 18 2025 06:17:33 for ReactOS by
1.9.6