diff options
author | Konstantin Belousov <kib@FreeBSD.org> | 2021-10-03 01:52:39 +0000 |
---|---|---|
committer | Konstantin Belousov <kib@FreeBSD.org> | 2021-10-06 14:05:22 +0000 |
commit | b599982b65e36523a8aa828a9d504135144158db (patch) | |
tree | 342f1de5166064c812f05464ddfa2a889a25b54b /sys/kern/kern_sig.c | |
parent | 7f4bb501768b9b3f856f91fbc8b9c80a2a4aaa04 (diff) | |
download | src-b599982b65e36523a8aa828a9d504135144158db.tar.gz src-b599982b65e36523a8aa828a9d504135144158db.zip |
Move td_pflags2 TDP2_SIGWAIT to td_flags TDF_SIGWAIT
The flag should be accessible from non-current threads.
Reviewed by: markj
Tested by: trasz
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D32252
Diffstat (limited to 'sys/kern/kern_sig.c')
-rw-r--r-- | sys/kern/kern_sig.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c index 95eb8d5cc564..b20aea21333e 100644 --- a/sys/kern/kern_sig.c +++ b/sys/kern/kern_sig.c @@ -1278,8 +1278,11 @@ kern_sigtimedwait(struct thread *td, sigset_t waitset, ksiginfo_t *ksi, saved_mask = td->td_sigmask; SIGSETNAND(td->td_sigmask, waitset); if ((p->p_sysent->sv_flags & SV_SIG_DISCIGN) != 0 || - !kern_sig_discard_ign) - td->td_pflags2 |= TDP2_SIGWAIT; + !kern_sig_discard_ign) { + thread_lock(td); + td->td_flags |= TDF_SIGWAIT; + thread_unlock(td); + } for (;;) { mtx_lock(&ps->ps_mtx); sig = cursig(td); @@ -1343,7 +1346,9 @@ kern_sigtimedwait(struct thread *td, sigset_t waitset, ksiginfo_t *ksi, if (error == 0 && (p->p_ptevents & PTRACE_SYSCALL) != 0) traced = true; } - td->td_pflags2 &= ~TDP2_SIGWAIT; + thread_lock(td); + td->td_flags &= ~TDF_SIGWAIT; + thread_unlock(td); new_block = saved_mask; SIGSETNAND(new_block, td->td_sigmask); @@ -2951,7 +2956,7 @@ issignal(struct thread *td) */ if (SIGISMEMBER(ps->ps_sigignore, sig) && (p->p_flag & P_TRACED) == 0 && - (td->td_pflags2 & TDP2_SIGWAIT) == 0) { + (td->td_flags & TDF_SIGWAIT) == 0) { sigqueue_delete(&td->td_sigqueue, sig); sigqueue_delete(&p->p_sigqueue, sig); continue; @@ -3064,7 +3069,7 @@ issignal(struct thread *td) mtx_lock(&ps->ps_mtx); goto next; } else if ((prop & SIGPROP_IGNORE) != 0 && - (td->td_pflags2 & TDP2_SIGWAIT) == 0) { + (td->td_flags & TDF_SIGWAIT) == 0) { /* * Default action is to ignore; drop it if * not in kern_sigtimedwait(). @@ -3075,7 +3080,7 @@ issignal(struct thread *td) /*NOTREACHED*/ case (intptr_t)SIG_IGN: - if ((td->td_pflags2 & TDP2_SIGWAIT) == 0) + if ((td->td_flags & TDF_SIGWAIT) == 0) break; /* == ignore */ else return (sig); |