HomeFreeBSD

select: make sure there are no wakeup attempts after selfdfree returns

Description

select: make sure there are no wakeup attempts after selfdfree returns

Prior to the patch returning selfdfree could still be racing against doselwakeup
which set sf_si = NULL and now locks stp to wake up the other thread.

A sufficiently unlucky pair can end up going all the way down to freeing
select-related structures before the lock/wakeup/unlock finishes.

This started manifesting itself as crashes since select data started getting
freed in r367714.

Details

Provenance
mjgAuthored on Dec 2 2020, 12:48 AM
Parents
R10:013a1ae66e1f: Fix syntax
Branches
Unknown
Tags
Unknown