Commit e00cbef0 authored by Paul Gofman's avatar Paul Gofman Committed by Alexandre Julliard

ntdll: Pre-check entry->addr before taking a spin lock in RtlWaitOnAddress().

parent 56d56ec6
......@@ -898,11 +898,14 @@ NTSTATUS WINAPI RtlWaitOnAddress( const void *addr, const void *cmp, SIZE_T size
ret = NtWaitForAlertByThreadId( NULL, timeout );
spin_lock( &queue->lock );
/* We may have already been removed by a call to RtlWakeAddressSingle(). */
/* We may have already been removed by a call to RtlWakeAddressSingle() or RtlWakeAddressAll(). */
if (entry.addr)
list_remove( &entry.entry );
spin_unlock( &queue->lock );
{
spin_lock( &queue->lock );
if (entry.addr)
list_remove( &entry.entry );
spin_unlock( &queue->lock );
}
TRACE("returning %#lx\n", ret);
......
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