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
35e56fb0
Commit
35e56fb0
authored
Jun 21, 2014
by
Sebastian Lackner
Committed by
Alexandre Julliard
Jun 23, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
server: Avoid invalid memory access when thread is killed while in wake_up(). (Valgrind).
parent
3447567b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
4 deletions
+8
-4
thread.c
server/thread.c
+8
-4
No files found.
server/thread.c
View file @
35e56fb0
...
...
@@ -700,7 +700,7 @@ static int send_thread_wakeup( struct thread *thread, client_ptr_t cookie, int s
}
/* attempt to wake up a thread */
/* return >0 if OK, 0 if the wait condition is still not satisfied */
/* return >0 if OK, 0 if the wait condition is still not satisfied
and -1 on error
*/
int
wake_thread
(
struct
thread
*
thread
)
{
int
signaled
,
count
;
...
...
@@ -714,7 +714,10 @@ int wake_thread( struct thread *thread )
if
(
debug_level
)
fprintf
(
stderr
,
"%04x: *wakeup* signaled=%d
\n
"
,
thread
->
id
,
signaled
);
end_wait
(
thread
);
if
(
send_thread_wakeup
(
thread
,
cookie
,
signaled
)
==
-
1
)
/* error */
break
;
{
if
(
!
count
)
count
=
-
1
;
break
;
}
}
return
count
;
}
...
...
@@ -865,12 +868,13 @@ static timeout_t select_on( const select_op_t *select_op, data_size_t op_size, c
void
wake_up
(
struct
object
*
obj
,
int
max
)
{
struct
list
*
ptr
;
int
ret
;
LIST_FOR_EACH
(
ptr
,
&
obj
->
wait_queue
)
{
struct
wait_queue_entry
*
entry
=
LIST_ENTRY
(
ptr
,
struct
wait_queue_entry
,
entry
);
if
(
!
wake_thread
(
get_wait_queue_thread
(
entry
)))
continue
;
if
(
max
&&
!--
max
)
break
;
if
(
!
(
ret
=
wake_thread
(
get_wait_queue_thread
(
entry
)
)))
continue
;
if
(
ret
>
0
&&
max
&&
!--
max
)
break
;
/* restart at the head of the list since a wake up can change the object wait queue */
ptr
=
&
obj
->
wait_queue
;
}
...
...
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