Paul Gofman : winhttp: Keep task in queue until completion.
Alexandre Julliard
julliard at winehq.org
Wed Jun 8 15:56:05 CDT 2022
Module: wine
Branch: master
Commit: 5d2f2797e32f84993e898c18cd422e2a0514ba3d
URL: https://source.winehq.org/git/wine.git/?a=commit;h=5d2f2797e32f84993e898c18cd422e2a0514ba3d
Author: Paul Gofman <pgofman at codeweavers.com>
Date: Mon Jun 6 21:49:07 2022 -0500
winhttp: Keep task in queue until completion.
Signed-off-by: Paul Gofman <pgofman at codeweavers.com>
---
dlls/winhttp/request.c | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/dlls/winhttp/request.c b/dlls/winhttp/request.c
index fe703c19109..9abe4f45598 100644
--- a/dlls/winhttp/request.c
+++ b/dlls/winhttp/request.c
@@ -135,15 +135,16 @@ void stop_queue( struct queue *queue )
TRACE("stopped %p\n", queue);
}
-static struct task_header *get_next_task( struct queue *queue )
+static struct task_header *get_next_task( struct queue *queue, struct task_header *prev_task )
{
struct list *entry;
AcquireSRWLockExclusive( &queue->lock );
assert( queue->callback_running );
- if ((entry = list_head( &queue->queued_tasks )))
- list_remove( entry );
- else
+ if (prev_task)
+ list_remove( &prev_task->entry );
+
+ if (!(entry = list_head( &queue->queued_tasks )))
queue->callback_running = FALSE;
ReleaseSRWLockExclusive( &queue->lock );
if (!entry) return NULL;
@@ -157,12 +158,12 @@ static void CALLBACK task_callback( TP_CALLBACK_INSTANCE *instance, void *ctx )
TRACE( "instance %p.\n", instance );
- task = get_next_task( queue );
+ task = get_next_task( queue, NULL );
while (task)
{
task->callback( task );
/* Queue object may be freed by release_object() unless there is another task referencing it. */
- next_task = get_next_task( queue );
+ next_task = get_next_task( queue, task );
release_object( task->obj );
free( task );
task = next_task;
More information about the wine-cvs
mailing list