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
de9f5b33
Commit
de9f5b33
authored
Aug 22, 2013
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
server: Store the wait structure in the wait entry and add an accessor function for the thread.
parent
d21b05b0
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
14 additions
and
8 deletions
+14
-8
object.h
server/object.h
+3
-3
queue.c
server/queue.c
+3
-3
thread.c
server/thread.c
+7
-2
thread.h
server/thread.h
+1
-0
No files found.
server/object.h
View file @
de9f5b33
...
...
@@ -106,9 +106,9 @@ struct object
struct
wait_queue_entry
{
struct
list
entry
;
struct
object
*
obj
;
struct
thread
*
thread
;
struct
list
entry
;
struct
object
*
obj
;
struct
thread
_wait
*
wait
;
};
extern
void
*
mem_alloc
(
size_t
size
);
/* malloc wrapper */
...
...
server/queue.c
View file @
de9f5b33
...
...
@@ -866,7 +866,7 @@ static int is_queue_hung( struct msg_queue *queue )
LIST_FOR_EACH_ENTRY
(
entry
,
&
queue
->
obj
.
wait_queue
,
struct
wait_queue_entry
,
entry
)
{
if
(
entry
->
thread
->
queue
==
queue
)
if
(
get_wait_queue_thread
(
entry
)
->
queue
==
queue
)
return
0
;
/* thread is waiting on queue -> not hung */
}
return
1
;
...
...
@@ -875,10 +875,10 @@ static int is_queue_hung( struct msg_queue *queue )
static
int
msg_queue_add_queue
(
struct
object
*
obj
,
struct
wait_queue_entry
*
entry
)
{
struct
msg_queue
*
queue
=
(
struct
msg_queue
*
)
obj
;
struct
process
*
process
=
entry
->
thread
->
process
;
struct
process
*
process
=
get_wait_queue_thread
(
entry
)
->
process
;
/* a thread can only wait on its own queue */
if
(
entry
->
thread
->
queue
!=
queue
)
if
(
get_wait_queue_thread
(
entry
)
->
queue
!=
queue
)
{
set_error
(
STATUS_ACCESS_DENIED
);
return
0
;
...
...
server/thread.c
View file @
de9f5b33
...
...
@@ -543,6 +543,11 @@ void remove_queue( struct object *obj, struct wait_queue_entry *entry )
release_object
(
obj
);
}
struct
thread
*
get_wait_queue_thread
(
struct
wait_queue_entry
*
entry
)
{
return
entry
->
wait
->
thread
;
}
/* finish waiting */
static
void
end_wait
(
struct
thread
*
thread
)
{
...
...
@@ -579,7 +584,7 @@ static int wait_on( const select_op_t *select_op, unsigned int count, struct obj
for
(
i
=
0
,
entry
=
wait
->
queues
;
i
<
count
;
i
++
,
entry
++
)
{
struct
object
*
obj
=
objects
[
i
];
entry
->
thread
=
curren
t
;
entry
->
wait
=
wai
t
;
if
(
!
obj
->
ops
->
add_queue
(
obj
,
entry
))
{
wait
->
count
=
i
;
...
...
@@ -809,7 +814,7 @@ void wake_up( struct object *obj, int max )
LIST_FOR_EACH
(
ptr
,
&
obj
->
wait_queue
)
{
struct
wait_queue_entry
*
entry
=
LIST_ENTRY
(
ptr
,
struct
wait_queue_entry
,
entry
);
if
(
!
wake_thread
(
entry
->
thread
))
continue
;
if
(
!
wake_thread
(
get_wait_queue_thread
(
entry
)
))
continue
;
if
(
max
&&
!--
max
)
break
;
/* restart at the head of the list since a wake up can change the object wait queue */
ptr
=
&
obj
->
wait_queue
;
...
...
server/thread.h
View file @
de9f5b33
...
...
@@ -105,6 +105,7 @@ 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
struct
thread
*
get_wait_queue_thread
(
struct
wait_queue_entry
*
entry
);
extern
void
stop_thread
(
struct
thread
*
thread
);
extern
void
stop_thread_if_suspended
(
struct
thread
*
thread
);
extern
int
wake_thread
(
struct
thread
*
thread
);
...
...
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