Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alexey Alyaev
wine
Commits
48b74b32
Commit
48b74b32
authored
18 years ago
by
Alexandre Julliard
Browse files
Options
Downloads
Patches
Plain Diff
server: Split get_thread_from_pid to allow lookups by tid or pid only.
parent
f231a70f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
server/ptrace.c
+6
-1
6 additions, 1 deletion
server/ptrace.c
server/thread.c
+11
-3
11 additions, 3 deletions
server/thread.c
server/thread.h
+1
-0
1 addition, 0 deletions
server/thread.h
with
18 additions
and
4 deletions
server/ptrace.c
+
6
−
1
View file @
48b74b32
...
...
@@ -144,7 +144,12 @@ void sigchld_callback(void)
for
(;;)
{
if
(
!
(
pid
=
wait4_wrapper
(
-
1
,
&
status
,
WUNTRACED
|
WNOHANG
,
NULL
)))
break
;
if
(
pid
!=
-
1
)
handle_child_status
(
get_thread_from_pid
(
pid
),
pid
,
status
,
-
1
);
if
(
pid
!=
-
1
)
{
struct
thread
*
thread
=
get_thread_from_tid
(
pid
);
if
(
!
thread
)
thread
=
get_thread_from_pid
(
pid
);
handle_child_status
(
thread
,
pid
,
status
,
-
1
);
}
else
break
;
}
}
...
...
This diff is collapsed.
Click to expand it.
server/thread.c
+
11
−
3
View file @
48b74b32
...
...
@@ -297,15 +297,23 @@ struct thread *get_thread_from_handle( obj_handle_t handle, unsigned int access
access
,
&
thread_ops
);
}
/* find a thread from a Unix
p
id */
struct
thread
*
get_thread_from_
p
id
(
int
p
id
)
/* find a thread from a Unix
t
id */
struct
thread
*
get_thread_from_
t
id
(
int
t
id
)
{
struct
thread
*
thread
;
LIST_FOR_EACH_ENTRY
(
thread
,
&
thread_list
,
struct
thread
,
entry
)
{
if
(
thread
->
unix_tid
==
p
id
)
return
thread
;
if
(
thread
->
unix_tid
==
t
id
)
return
thread
;
}
return
NULL
;
}
/* find a thread from a Unix pid */
struct
thread
*
get_thread_from_pid
(
int
pid
)
{
struct
thread
*
thread
;
LIST_FOR_EACH_ENTRY
(
thread
,
&
thread_list
,
struct
thread
,
entry
)
{
if
(
thread
->
unix_pid
==
pid
)
return
thread
;
...
...
This diff is collapsed.
Click to expand it.
server/thread.h
+
1
−
0
View file @
48b74b32
...
...
@@ -103,6 +103,7 @@ extern struct thread *current;
extern
struct
thread
*
create_thread
(
int
fd
,
struct
process
*
process
);
extern
struct
thread
*
get_thread_from_id
(
thread_id_t
id
);
extern
struct
thread
*
get_thread_from_handle
(
obj_handle_t
handle
,
unsigned
int
access
);
extern
struct
thread
*
get_thread_from_tid
(
int
tid
);
extern
struct
thread
*
get_thread_from_pid
(
int
pid
);
extern
void
stop_thread
(
struct
thread
*
thread
);
extern
int
wake_thread
(
struct
thread
*
thread
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment