Zebediah Figura (@zfigura) commented about dlls/ntdll/sync.c:
- { - /* Not locked exclusive, and no exclusive waiters. - * We can try to grab it. */ - ++new.s.owners; - wait = FALSE; - } - else - { - wait = TRUE; - } - } while (InterlockedCompareExchange( u.l, new.l, old.l ) != old.l); + if (tag & SRWLOCK_TAG_LIST_LOCKED) { + /* We only ever blocking wait on &lock->Ptr for the LIST_LOCKED bit. */ + RtlWaitOnAddress(&lock->Ptr, &expected.Ptr, sizeof(expected.Ptr), NULL); + return FALSE; + } Does the futex wait/wake really help here? I'm curious what the effects are of removing it on your various benchmarks.
(Side note, this patch has some inconsistent style in a lot of places wrt. braces placement or spacing; it'd probably be nice to make that consistent.) -- https://gitlab.winehq.org/wine/wine/-/merge_requests/3504#note_46112