ntdll: Remove entries from queue in RtlWakeAddressAll().

This commit is contained in:
Paul Gofman 2023-09-21 16:23:33 -06:00 committed by Alexandre Julliard
parent fffed9b3b1
commit 56d56ec629

View file

@ -916,8 +916,8 @@ NTSTATUS WINAPI RtlWaitOnAddress( const void *addr, const void *cmp, SIZE_T size
void WINAPI RtlWakeAddressAll( const void *addr )
{
struct futex_queue *queue = get_futex_queue( addr );
struct futex_entry *entry, *next;
unsigned int count = 0, i;
struct futex_entry *entry;
DWORD tids[256];
TRACE("%p\n", addr);
@ -929,10 +929,12 @@ void WINAPI RtlWakeAddressAll( const void *addr )
if (!queue->queue.next)
list_init(&queue->queue);
LIST_FOR_EACH_ENTRY( entry, &queue->queue, struct futex_entry, entry )
LIST_FOR_EACH_ENTRY_SAFE( entry, next, &queue->queue, struct futex_entry, entry )
{
if (entry->addr == addr)
{
entry->addr = NULL;
list_remove( &entry->entry );
/* Try to buffer wakes, so that we don't make a system call while
* holding a spinlock. */
if (count < ARRAY_SIZE(tids))