Zebediah Figura (@zfigura) commented about dlls/ntdll/sync.c:
+ + read.Ptr = InterlockedCompareExchangePointer(&lock->Ptr, new.Ptr, old.Ptr); + if (read.Ptr == old.Ptr) + break; + old = read; + } while (TRUE);
- if (!wait) return; - RtlWaitOnAddress( &u.s->owners, &new.s.owners, sizeof(short), NULL ); + while (TRUE) + { + /* waking up the waiter will invalidate the waiter's entry in + * the list. */ + struct srwlock_waiter *next = head->next; + InterlockedOr((LONG *)&head->state, SRWLOCK_WAITER_STATE_NOTIFIED); + RtlWakeAddressSingle(&head->state); It's no surprise that the waiter struct includes the TID, because I notice that we should be able to bypass win32 futexes and use TID alerts directly here.
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/3504#note_43112