Zebediah Figura (@zfigura) commented about dlls/ntdll/sync.c:
+ assert(last != NULL); + head = last->head; + assert(head != NULL); + last_up_to_date = last; /* the last waiter whose head pointer is up-to-date. */ + new_head = NULL; + if (head->num_owners != 0 && + head->num_owners != SRWLOCK_WAITER_EXCLUSIVELY_LOCKED) { - union { struct srw_lock s; LONG l; } old, new; - BOOL wait; + FIXME("head num_owners %lx\n", head->num_owners); + assert(FALSE); + } + head->num_owners = 0; + last_to_remove = head; + do do {} while (TRUE) is, while perfectly fine, arguably a bit less readable than just while (TRUE) {}. I suspect this was originally written with the cmpxchg in the condition, but then that didn't quite work out :-)
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/3504#note_43104