Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
1e783dbf
Commit
1e783dbf
authored
Feb 26, 2015
by
Andrew Eikum
Committed by
Alexandre Julliard
Feb 26, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
services: Monitor process handles for process quit.
parent
c731ed30
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
4 deletions
+22
-4
rpc.c
programs/services/rpc.c
+22
-4
No files found.
programs/services/rpc.c
View file @
1e783dbf
...
@@ -1623,7 +1623,7 @@ DWORD events_loop(void)
...
@@ -1623,7 +1623,7 @@ DWORD events_loop(void)
{
{
struct
timeout_queue_elem
*
iter
,
*
iter_safe
;
struct
timeout_queue_elem
*
iter
,
*
iter_safe
;
DWORD
err
;
DWORD
err
;
HANDLE
wait_handles
[
2
];
HANDLE
wait_handles
[
MAXIMUM_WAIT_OBJECTS
];
DWORD
timeout
=
INFINITE
;
DWORD
timeout
=
INFINITE
;
wait_handles
[
0
]
=
__wine_make_process_system
();
wait_handles
[
0
]
=
__wine_make_process_system
();
...
@@ -1636,13 +1636,29 @@ DWORD events_loop(void)
...
@@ -1636,13 +1636,29 @@ DWORD events_loop(void)
do
do
{
{
err
=
WaitForMultipleObjects
(
2
,
wait_handles
,
FALSE
,
timeout
);
DWORD
num_handles
=
2
;
/* monitor tracked process handles for process end */
EnterCriticalSection
(
&
timeout_queue_cs
);
LIST_FOR_EACH_ENTRY
(
iter
,
&
timeout_queue
,
struct
timeout_queue_elem
,
entry
)
{
if
(
num_handles
==
MAXIMUM_WAIT_OBJECTS
){
WINE_TRACE
(
"Exceeded maximum wait object count
\n
"
);
break
;
}
wait_handles
[
num_handles
]
=
iter
->
service_entry
->
process
;
num_handles
++
;
}
LeaveCriticalSection
(
&
timeout_queue_cs
);
err
=
WaitForMultipleObjects
(
num_handles
,
wait_handles
,
FALSE
,
timeout
);
WINE_TRACE
(
"Wait returned %d
\n
"
,
err
);
WINE_TRACE
(
"Wait returned %d
\n
"
,
err
);
if
(
err
==
WAIT_OBJECT_0
+
1
||
err
==
WAIT_TIMEOUT
)
if
(
err
>
WAIT_OBJECT_0
||
err
==
WAIT_TIMEOUT
)
{
{
FILETIME
cur_time
;
FILETIME
cur_time
;
ULARGE_INTEGER
time
;
ULARGE_INTEGER
time
;
DWORD
idx
=
0
;
GetSystemTimeAsFileTime
(
&
cur_time
);
GetSystemTimeAsFileTime
(
&
cur_time
);
time
.
u
.
LowPart
=
cur_time
.
dwLowDateTime
;
time
.
u
.
LowPart
=
cur_time
.
dwLowDateTime
;
...
@@ -1652,7 +1668,8 @@ DWORD events_loop(void)
...
@@ -1652,7 +1668,8 @@ DWORD events_loop(void)
timeout
=
INFINITE
;
timeout
=
INFINITE
;
LIST_FOR_EACH_ENTRY_SAFE
(
iter
,
iter_safe
,
&
timeout_queue
,
struct
timeout_queue_elem
,
entry
)
LIST_FOR_EACH_ENTRY_SAFE
(
iter
,
iter_safe
,
&
timeout_queue
,
struct
timeout_queue_elem
,
entry
)
{
{
if
(
CompareFileTime
(
&
cur_time
,
&
iter
->
time
)
>=
0
)
if
(
CompareFileTime
(
&
cur_time
,
&
iter
->
time
)
>=
0
||
(
err
>
WAIT_OBJECT_0
+
1
&&
idx
==
err
-
WAIT_OBJECT_0
-
2
))
{
{
LeaveCriticalSection
(
&
timeout_queue_cs
);
LeaveCriticalSection
(
&
timeout_queue_cs
);
iter
->
func
(
iter
->
service_entry
);
iter
->
func
(
iter
->
service_entry
);
...
@@ -1673,6 +1690,7 @@ DWORD events_loop(void)
...
@@ -1673,6 +1690,7 @@ DWORD events_loop(void)
if
(
time_diff
.
QuadPart
<
timeout
)
if
(
time_diff
.
QuadPart
<
timeout
)
timeout
=
time_diff
.
QuadPart
;
timeout
=
time_diff
.
QuadPart
;
}
}
idx
++
;
}
}
LeaveCriticalSection
(
&
timeout_queue_cs
);
LeaveCriticalSection
(
&
timeout_queue_cs
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment