Revert part of r300109.
authormarkj <markj@FreeBSD.org>
Thu, 22 Dec 2016 17:51:44 +0000 (17:51 +0000)
committermarkj <markj@FreeBSD.org>
Thu, 22 Dec 2016 17:51:44 +0000 (17:51 +0000)
commit697ac35642dc5a0df4ffed73e58b0e3a80adde37
tree8b387ce4ea9e0011dba17239b66a15cecf71a378
parent64c9c06ec360e31eb0bcf76307bbe4d19612deda
Revert part of r300109.

The removal of TAILQ_FOREACH_SAFE introduced a small race: when the last
thread on a sleepqueue is awoken, it reclaims the sleepqueue and may begin
executing on a different CPU before sleepq_resume_thread() returns. This
leaves a window during which it may go back to sleep and incorrectly be
awoken again by the caller of sleepq_broadcast().

Reported and tested by: pho
MFC after: 3 days
Sponsored by: Dell EMC Isilon
sys/kern/subr_sleepqueue.c