server: Choose newer async object when searching from client pointer.

This fixes a race. Client may release and reuse async pointer while
processing APC_ASYNC_IO. It is, however, guaranteed that
get_async_result will be called on the newest one known to the server.

Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Jacek Caban 2017-02-10 16:05:39 +01:00 committed by Alexandre Julliard
parent e07d20f3f3
commit 13204d87cf

View file

@ -255,7 +255,7 @@ struct async *create_async( struct thread *thread, struct async_queue *queue, co
else async->iosb = NULL;
list_add_tail( &queue->queue, &async->queue_entry );
list_add_tail( &thread->process->asyncs, &async->process_entry );
list_add_head( &thread->process->asyncs, &async->process_entry );
grab_object( async );
if (queue->fd) set_fd_signaled( queue->fd, 0 );