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.
This commit is contained in:
parent
9b778a1611
commit
51362c2d8a
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user