Zebediah Figura (@zfigura) commented about dlls/ntdll/sync.c:
}
while (last_up_to_date != last)
{
last_up_to_date = ReadPointerAcquire((void **)&last_up_to_date->next);
assert(last_up_to_date != NULL);
last_up_to_date->head = new_head;
}
tag = SRWLOCK_TAG_LOCKED;
if (new_head)
{
tag |= SRWLOCK_TAG_HAS_WAITERS;
if (new_head->num_owners > 1 &&
new_head->num_owners != SRWLOCK_WAITER_EXCLUSIVELY_LOCKED)
tag |= SRWLOCK_TAG_HAS_MULTIPLE_OWNERS;
I hate this indentation, because the continuation is at the same level as the body and looks the same. I'd rather either not wrap the if, or add braces. (In d3d we use eight-space indentation and put the && at the beginning of the line, which avoids the problem, but sadly that's not what we do in ntdll.)
Actually, isn't this "if (new_head != last)"? Which should be a cheaper comparison anyway.