summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordavidxu <davidxu@FreeBSD.org>2004-01-03 23:36:31 +0000
committerdavidxu <davidxu@FreeBSD.org>2004-01-03 23:36:31 +0000
commita6c2fc0f084fd2638d9cf79470bc3cc4f7c62c2d (patch)
treeae40cb69bb891cfb0e658f4674d401729fc7a079
parentd72ded3ec8fc51eb854beabed52ae30e359bed23 (diff)
downloadFreeBSD-src-a6c2fc0f084fd2638d9cf79470bc3cc4f7c62c2d.zip
FreeBSD-src-a6c2fc0f084fd2638d9cf79470bc3cc4f7c62c2d.tar.gz
Make sigaltstack as per-threaded, because per-process sigaltstack state
is useless for threaded programs, multiple threads can not share same stack. The alternative signal stack is private for thread, no lock is needed, the orignal P_ALTSTACK is now moved into td_pflags and renamed to TDP_ALTSTACK. For single thread or Linux clone() based threaded program, there is no semantic changed, because those programs only have one kernel thread in every process.
-rw-r--r--sys/alpha/osf1/osf1_signal.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/sys/alpha/osf1/osf1_signal.c b/sys/alpha/osf1/osf1_signal.c
index d318a55..0aecf01 100644
--- a/sys/alpha/osf1/osf1_signal.c
+++ b/sys/alpha/osf1/osf1_signal.c
@@ -485,11 +485,11 @@ osf1_sendsig(sig_t catcher, int sig, sigset_t *mask, u_long code)
* and the useracc() check will fail if the process has not already
* allocated the space with a `brk'.
*/
- if ((p->p_flag & P_ALTSTACK) && !oonstack &&
+ if ((td->td_pflags & TDP_ALTSTACK) && !oonstack &&
SIGISMEMBER(psp->ps_sigonstack, sig)) {
- sip = (osiginfo_t *)((caddr_t)p->p_sigstk.ss_sp +
- p->p_sigstk.ss_size - rndfsize);
- p->p_sigstk.ss_flags |= SS_ONSTACK;
+ sip = (osiginfo_t *)((caddr_t)td->td_sigstk.ss_sp +
+ td->td_sigstk.ss_size - rndfsize);
+ td->td_sigstk.ss_flags |= SS_ONSTACK;
} else
sip = (osiginfo_t *)(alpha_pal_rdusp() - rndfsize);
mtx_unlock(&psp->ps_mtx);
@@ -588,9 +588,9 @@ osf1_sigreturn(struct thread *td,
*/
PROC_LOCK(p);
if (ksc.sc_onstack)
- p->p_sigstk.ss_flags |= SS_ONSTACK;
+ td->td_sigstk.ss_flags |= SS_ONSTACK;
else
- p->p_sigstk.ss_flags &= ~SS_ONSTACK;
+ td->td_sigstk.ss_flags &= ~SS_ONSTACK;
/*
* longjmp is still implemented by calling osigreturn. The new
OpenPOWER on IntegriCloud