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
110a6fe5
Commit
110a6fe5
authored
Nov 10, 2006
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
server: Properly handle kill_thread recursion when killing a process.
Spotted by Mike McCormack.
parent
35c08869
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
5 deletions
+17
-5
process.c
server/process.c
+17
-5
No files found.
server/process.c
View file @
110a6fe5
...
...
@@ -515,15 +515,25 @@ static void process_unload_dll( struct process *process, void *base )
/* terminate a process with the given exit code */
static
void
terminate_process
(
struct
process
*
process
,
struct
thread
*
skip
,
int
exit_code
)
{
struct
list
*
ptr
,
*
next
;
struct
list
*
ptr
;
if
(
skip
)
/* move it to the end of the list */
{
assert
(
skip
->
state
!=
TERMINATED
);
list_remove
(
&
skip
->
proc_entry
);
list_add_tail
(
&
process
->
thread_list
,
&
skip
->
proc_entry
);
}
LIST_FOR_EACH_SAFE
(
ptr
,
next
,
&
process
->
thread_list
)
grab_object
(
process
);
/* make sure it doesn't get freed when threads die */
while
((
ptr
=
list_head
(
&
process
->
thread_list
)))
{
struct
thread
*
thread
=
LIST_ENTRY
(
ptr
,
struct
thread
,
proc_entry
);
if
(
exit_code
)
thread
->
exit_code
=
exit_code
;
if
(
thread
!=
skip
)
kill_thread
(
thread
,
1
);
if
(
thread
==
skip
)
break
;
kill_thread
(
thread
,
1
);
}
release_object
(
process
);
}
/* kill all processes */
...
...
@@ -657,13 +667,15 @@ void kill_process( struct process *process, int violent_death )
if
(
violent_death
)
terminate_process
(
process
,
NULL
,
1
);
else
{
struct
list
*
ptr
,
*
next
;
struct
list
*
ptr
;
LIST_FOR_EACH_SAFE
(
ptr
,
next
,
&
process
->
thread_list
)
grab_object
(
process
);
/* make sure it doesn't get freed when threads die */
while
((
ptr
=
list_head
(
&
process
->
thread_list
)))
{
struct
thread
*
thread
=
LIST_ENTRY
(
ptr
,
struct
thread
,
proc_entry
);
kill_thread
(
thread
,
0
);
}
release_object
(
process
);
}
}
...
...
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