]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Refactor sleepq_catch_signals().
authorKonstantin Belousov <kib@FreeBSD.org>
Sun, 4 Oct 2020 16:30:05 +0000 (16:30 +0000)
committerKonstantin Belousov <kib@FreeBSD.org>
Sun, 4 Oct 2020 16:30:05 +0000 (16:30 +0000)
commit0c82fb267b8b26c02f8e313ebf6cc5103d40da3a
treedf0f0241b1a1a8bde24ead0850bde53ef727c94f
parent9f2d6263bbde8e64fa1abad4bcb154cf5af7a5c8
Refactor sleepq_catch_signals().

- Extract suspension check into sig_ast_checksusp() helper.
- Extract signal check and calculation of the interruption errno into
  sig_ast_needsigchk() helper.
The helpers are moved to kern_sig.c which is the proper place for
signal-related code.

Improve control flow in sleepq_catch_signals(), to handle ret == 0
(can sleep) and ret != 0 (interrupted) only once, by separating
checking code into sleepq_check_ast_sq_locked(), which return value is
interpreted at single location.

Reviewed by: markj
Tested by: pho
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Differential revision: https://reviews.freebsd.org/D26628
sys/kern/kern_sig.c
sys/kern/subr_sleepqueue.c
sys/sys/signalvar.h