Commit fd78e6e3 authored by Alexandre Julliard's avatar Alexandre Julliard

server: Restart at the head of the wait queue when we woke a thread, since this…

server: Restart at the head of the wait queue when we woke a thread, since this can modify the queue.
parent 3fe51326
......@@ -712,15 +712,15 @@ done:
/* attempt to wake threads sleeping on the object wait queue */
void wake_up( struct object *obj, int max )
{
struct list *ptr, *next;
struct list *ptr;
LIST_FOR_EACH_SAFE( ptr, next, &obj->wait_queue )
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 ))
{
if (!wake_thread( entry->thread )) 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;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment