]> git.ipfire.org Git - thirdparty/glibc.git/commit
nptl: Remove unnecessary catch-all-wake in condvar group switch
authorMalte Skarupke <malteskarupke@fastmail.fm>
Wed, 4 Dec 2024 12:55:50 +0000 (07:55 -0500)
committerCarlos O'Donell <carlos@redhat.com>
Fri, 17 Jan 2025 19:56:58 +0000 (14:56 -0500)
commitb42cc6af11062c260c7dfa91f1c89891366fed3e
treefd68a897155668cf407af4d61fc6327a138c84be
parent0cc973160c23bb67f895bc887dd6942d29f8fee3
nptl: Remove unnecessary catch-all-wake in condvar group switch

This wake is unnecessary. We only switch groups after every sleeper in a group
has been woken. Sure, they may take a while to actually wake up and may still
hold a reference, but waking them a second time doesn't speed that up. Instead
this just makes the code more complicated and may hide problems.

In particular this safety wake wouldn't even have helped with the bug that was
fixed by Barrus' patch: The bug there was that pthread_cond_signal would not
switch g1 when it should, so we wouldn't even have entered this code path.

Signed-off-by: Malte Skarupke <malteskarupke@fastmail.fm>
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
nptl/pthread_cond_common.c