]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
sleepq_catch_signals: do thread suspension before signal check
authorEric Badger <badger@FreeBSD.org>
Tue, 14 Feb 2017 17:13:23 +0000 (17:13 +0000)
committerEric Badger <badger@FreeBSD.org>
Tue, 14 Feb 2017 17:13:23 +0000 (17:13 +0000)
commit28d2efa9830c6c4673833ad709bbc4246c4534f0
treed159f9f0058c1cd3fc839c157dad5eb173b11fd8
parent111142bcf1ad04e8325dd88351c5e6b3bc04b816
sleepq_catch_signals: do thread suspension before signal check

Since locks are dropped when a thread suspends, it's possible for another
thread to deliver a signal to the suspended thread. If the thread awakens from
suspension without checking for signals, it may go to sleep despite having
a pending signal that should wake it up. Therefore the suspension check is
done first, so any signals sent while suspended will be caught in the
subsequent signal check.

Reviewed by: kib
Approved by: kib (mentor)
MFC after: 2 weeks
Sponsored by: Dell EMC
Differential Revision: https://reviews.freebsd.org/D9530
sys/kern/subr_sleepqueue.c