Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
73209eb7
Commit
73209eb7
authored
Feb 25, 2005
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Convert the global thread list to a standard list.
parent
48c0d51d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
15 deletions
+15
-15
thread.c
server/thread.c
+14
-13
thread.h
server/thread.h
+1
-2
No files found.
server/thread.c
View file @
73209eb7
...
...
@@ -103,7 +103,7 @@ static const struct fd_ops thread_fd_ops =
no_cancel_async
/* cancel_async */
};
static
struct
thread
*
first_thread
;
static
struct
list
thread_list
=
LIST_INIT
(
thread_list
)
;
static
struct
thread
*
booting_thread
;
/* initialize the structure for a newly allocated thread */
...
...
@@ -130,8 +130,6 @@ inline static void init_thread_structure( struct thread *thread )
thread
->
state
=
RUNNING
;
thread
->
attached
=
0
;
thread
->
exit_code
=
0
;
thread
->
next
=
NULL
;
thread
->
prev
=
NULL
;
thread
->
priority
=
THREAD_PRIORITY_NORMAL
;
thread
->
affinity
=
1
;
thread
->
suspend
=
0
;
...
...
@@ -164,8 +162,7 @@ struct thread *create_thread( int fd, struct process *process )
lock_master_socket
(
1
);
}
if
((
thread
->
next
=
first_thread
)
!=
NULL
)
thread
->
next
->
prev
=
thread
;
first_thread
=
thread
;
list_add_head
(
&
thread_list
,
&
thread
->
entry
);
if
(
!
(
thread
->
id
=
alloc_ptid
(
thread
)))
{
...
...
@@ -241,9 +238,7 @@ static void destroy_thread( struct object *obj )
assert
(
obj
->
ops
==
&
thread_ops
);
assert
(
!
thread
->
debug_ctx
);
/* cannot still be debugging something */
if
(
thread
->
next
)
thread
->
next
->
prev
=
thread
->
prev
;
if
(
thread
->
prev
)
thread
->
prev
->
next
=
thread
->
next
;
else
first_thread
=
thread
->
next
;
list_remove
(
&
thread
->
entry
);
while
((
apc
=
thread_dequeue_apc
(
thread
,
0
)))
free
(
apc
);
cleanup_thread
(
thread
);
release_object
(
thread
->
process
);
...
...
@@ -287,10 +282,16 @@ struct thread *get_thread_from_handle( obj_handle_t handle, unsigned int access
/* find a thread from a Unix pid */
struct
thread
*
get_thread_from_pid
(
int
pid
)
{
struct
thread
*
t
;
struct
thread
*
t
hread
;
for
(
t
=
first_thread
;
t
;
t
=
t
->
next
)
if
(
t
->
unix_tid
==
pid
)
return
t
;
for
(
t
=
first_thread
;
t
;
t
=
t
->
next
)
if
(
t
->
unix_pid
==
pid
)
return
t
;
LIST_FOR_EACH_ENTRY
(
thread
,
&
thread_list
,
struct
thread
,
entry
)
{
if
(
thread
->
unix_tid
==
pid
)
return
thread
;
}
LIST_FOR_EACH_ENTRY
(
thread
,
&
thread_list
,
struct
thread
,
entry
)
{
if
(
thread
->
unix_pid
==
pid
)
return
thread
;
}
return
NULL
;
}
...
...
@@ -754,11 +755,11 @@ struct thread_snapshot *thread_snap( int *count )
struct
thread
*
thread
;
int
total
=
0
;
for
(
thread
=
first_thread
;
thread
;
thread
=
thread
->
next
)
LIST_FOR_EACH_ENTRY
(
thread
,
&
thread_list
,
struct
thread
,
entry
)
if
(
thread
->
state
!=
TERMINATED
)
total
++
;
if
(
!
total
||
!
(
snapshot
=
mem_alloc
(
sizeof
(
*
snapshot
)
*
total
)))
return
NULL
;
ptr
=
snapshot
;
for
(
thread
=
first_thread
;
thread
;
thread
=
thread
->
next
)
LIST_FOR_EACH_ENTRY
(
thread
,
&
thread_list
,
struct
thread
,
entry
)
{
if
(
thread
->
state
==
TERMINATED
)
continue
;
ptr
->
thread
=
thread
;
...
...
server/thread.h
View file @
73209eb7
...
...
@@ -50,8 +50,7 @@ struct inflight_fd
struct
thread
{
struct
object
obj
;
/* object header */
struct
thread
*
next
;
/* system-wide thread list */
struct
thread
*
prev
;
struct
list
entry
;
/* entry in system-wide thread list */
struct
thread
*
proc_next
;
/* per-process thread list */
struct
thread
*
proc_prev
;
struct
process
*
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