diff options
author | jhb <jhb@FreeBSD.org> | 2003-06-09 17:38:32 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2003-06-09 17:38:32 +0000 |
commit | ae455223406d6a2cafdf2f32371a238a5975973f (patch) | |
tree | 476de6b4741d7af0272c17c44aeeae777d33f434 /sys/kern/kern_sig.c | |
parent | 37d801936a730d980f3974cc25bfc18f11d8c1d2 (diff) | |
download | FreeBSD-src-ae455223406d6a2cafdf2f32371a238a5975973f.zip FreeBSD-src-ae455223406d6a2cafdf2f32371a238a5975973f.tar.gz |
- Add a td_pflags field to struct thread for private flags accessed only by
curthread. Unlike td_flags, this field does not need any locking.
- Replace the td_inktr and td_inktrace variables with equivalent private
thread flags.
- Move TDF_OLDMASK over to the private flags field so it no longer requires
sched_lock.
Diffstat (limited to 'sys/kern/kern_sig.c')
-rw-r--r-- | sys/kern/kern_sig.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c index ef4948f..6126f5f 100644 --- a/sys/kern/kern_sig.c +++ b/sys/kern/kern_sig.c @@ -874,7 +874,7 @@ out: mtx_unlock(&ps->ps_mtx); #ifdef KTRACE if (KTRPOINT(td, KTR_PSIG)) - ktrpsig(sig, action, td->td_flags & TDF_OLDMASK ? + ktrpsig(sig, action, td->td_pflags & TDP_OLDMASK ? &td->td_oldsigmask : &td->td_sigmask, 0); #endif _STOPEVENT(p, S_SIG, sig); @@ -1089,9 +1089,7 @@ kern_sigsuspend(struct thread *td, sigset_t mask) */ PROC_LOCK(p); td->td_oldsigmask = td->td_sigmask; - mtx_lock_spin(&sched_lock); - td->td_flags |= TDF_OLDMASK; - mtx_unlock_spin(&sched_lock); + td->td_pflags |= TDP_OLDMASK; SIG_CANTMASK(mask); td->td_sigmask = mask; signotify(td); @@ -1122,9 +1120,7 @@ osigsuspend(td, uap) PROC_LOCK(p); td->td_oldsigmask = td->td_sigmask; - mtx_lock_spin(&sched_lock); - td->td_flags |= TDF_OLDMASK; - mtx_unlock_spin(&sched_lock); + td->td_pflags |= TDP_OLDMASK; OSIG2SIG(uap->mask, mask); SIG_CANTMASK(mask); SIGSETLO(td->td_sigmask, mask); @@ -2136,7 +2132,7 @@ postsig(sig) action = ps->ps_sigact[_SIG_IDX(sig)]; #ifdef KTRACE if (KTRPOINT(td, KTR_PSIG)) - ktrpsig(sig, action, td->td_flags & TDF_OLDMASK ? + ktrpsig(sig, action, td->td_pflags & TDP_OLDMASK ? &td->td_oldsigmask : &td->td_sigmask, 0); #endif _STOPEVENT(p, S_SIG, sig); @@ -2164,11 +2160,9 @@ postsig(sig) * mask from before the sigsuspend is what we want * restored after the signal processing is completed. */ - if (td->td_flags & TDF_OLDMASK) { + if (td->td_pflags & TDP_OLDMASK) { returnmask = td->td_oldsigmask; - mtx_lock_spin(&sched_lock); - td->td_flags &= ~TDF_OLDMASK; - mtx_unlock_spin(&sched_lock); + td->td_pflags &= ~TDP_OLDMASK; } else returnmask = td->td_sigmask; |